home *** CD-ROM | disk | FTP | other *** search
Texinfo Document | 1989-11-22 | 17.7 KB |
open in:
MacOS 8.1
|
Win98
|
DOS
browse contents |
view JSON data
|
view as text
This file was processed as: Texinfo Document
(document/texInfo).
Confidence | Program | Detection | Match Type | Support
|
---|
100%
| dexvert
| LaTeX Document (document/latex)
| magic
| Supported |
100%
| dexvert
| Texinfo Document (document/texInfo)
| magic
| Supported |
1%
| dexvert
| Corel 10 Texture (image/corel10Texture)
| ext
| Unsupported |
1%
| dexvert
| Croteam texture file (image/croteamTextureFile)
| ext
| Unsupported |
1%
| dexvert
| Text File (text/txt)
| fallback
| Supported |
100%
| file
| TeX document text
| default
| |
99%
| file
| LaTeX document text
| default
| |
98%
| file
| LaTeX auxiliary file, ASCII text
| default
| |
100%
| perlTextCheck
| Likely Text (Perl)
| default
| |
100%
| detectItEasy
| Format: plain text[LF]
| default (weak)
| |
100%
| xdgMime
| text/x-matlab
| default (weak)
|
|
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 25 09 09 74 62 31 31 65 | 70 70 73 74 65 69 6e 2e |%..tb11e|ppstein.|
|00000010| 74 65 78 0a 0a 5c 54 69 | 74 6c 65 20 54 72 65 65 |tex..\Ti|tle Tree|
|00000020| 73 20 69 6e 20 5c 54 65 | 58 0a 5c 5c 44 61 76 69 |s in \Te|X.\\Davi|
|00000030| 64 20 45 70 70 73 74 65 | 69 6e 0a 5c 65 6e 64 78 |d Eppste|in.\endx|
|00000040| 0a 0a 25 09 54 68 69 73 | 20 70 61 70 65 72 20 77 |..%.This| paper w|
|00000050| 61 73 20 70 75 62 6c 69 | 73 68 65 64 20 69 6e 20 |as publi|shed in |
|00000060| 54 55 47 62 6f 61 74 20 | 36 23 31 2c 20 4d 61 72 |TUGboat |6#1, Mar|
|00000070| 63 68 20 31 39 38 35 2e | 0a 25 09 44 61 76 69 64 |ch 1985.|.%.David|
|00000080| 20 45 70 70 73 74 65 69 | 6e 27 73 20 61 64 64 72 | Eppstei|n's addr|
|00000090| 65 73 73 20 28 61 73 20 | 6f 66 20 31 35 20 4a 75 |ess (as |of 15 Ju|
|000000a0| 6e 65 20 31 39 38 38 29 | 20 69 73 0a 25 09 09 43 |ne 1988)| is.%..C|
|000000b0| 6f 6d 70 75 74 65 72 20 | 53 63 69 65 6e 63 65 20 |omputer |Science |
|000000c0| 44 65 70 61 72 74 6d 65 | 6e 74 0a 25 09 09 43 6f |Departme|nt.%..Co|
|000000d0| 6c 75 6d 62 69 61 20 55 | 6e 69 76 65 72 73 69 74 |lumbia U|niversit|
|000000e0| 79 0a 25 09 09 4e 65 77 | 20 59 6f 72 6b 2c 20 4e |y.%..New| York, N|
|000000f0| 59 20 31 30 30 32 37 0a | 25 09 09 45 70 70 73 74 |Y 10027.|%..Eppst|
|00000100| 65 69 6e 40 63 73 2e 43 | 6f 6c 75 6d 62 69 61 2e |ein@cs.C|olumbia.|
|00000110| 65 64 75 0a 0a 25 20 46 | 69 72 73 74 20 74 68 65 |edu..% F|irst the|
|00000120| 20 74 72 65 65 20 6d 61 | 63 72 6f 20 64 65 66 69 | tree ma|cro defi|
|00000130| 6e 69 74 69 6f 6e 73 2e | 0a 0a 5c 69 6e 70 75 74 |nitions.|..\input|
|00000140| 20 74 72 65 65 73 0a 0a | 25 20 4e 6f 77 20 74 68 | trees..|% Now th|
|00000150| 65 20 70 61 70 65 72 20 | 69 74 73 65 6c 66 0a 0a |e paper |itself..|
|00000160| 7b 5c 6f 62 65 79 73 70 | 61 63 65 73 5c 67 64 65 |{\obeysp|aces\gde|
|00000170| 66 20 7b 5c 69 66 76 6d | 6f 64 65 5c 69 6e 64 65 |f {\ifvm|ode\inde|
|00000180| 6e 74 5c 66 69 5c 73 70 | 61 63 65 7d 7d 0a 7b 5c |nt\fi\sp|ace}}.{\|
|00000190| 63 61 74 63 6f 64 65 20 | 60 7c 3d 30 20 5c 63 61 |catcode |`|=0 \ca|
|000001a0| 74 63 6f 64 65 60 5c 5c | 3d 31 32 20 7c 67 64 65 |tcode`\\|=12 |gde|
|000001b0| 66 7c 76 62 61 72 67 23 | 31 5c 65 6e 64 76 62 7b |f|vbarg#|1\endvb{|
|000001c0| 23 31 7c 65 6e 64 67 72 | 6f 75 70 7c 6d 65 64 73 |#1|endgr|oup|meds|
|000001d0| 6b 69 70 7d 7d 0a 5c 64 | 65 66 5c 6d 61 6b 65 6f |kip}}.\d|ef\makeo|
|000001e0| 74 68 65 72 23 31 7b 5c | 63 61 74 63 6f 64 65 60 |ther#1{\|catcode`|
|000001f0| 23 31 31 32 5c 72 65 6c | 61 78 7d 0a 5c 64 65 66 |#112\rel|ax}.\def|
|00000200| 5c 76 62 7b 5c 6d 65 64 | 73 6b 69 70 20 5c 62 65 |\vb{\med|skip \be|
|00000210| 67 69 6e 67 72 6f 75 70 | 20 5c 76 65 72 62 20 5c |gingroup| \verb \|
|00000220| 6f 62 65 79 6c 69 6e 65 | 73 20 5c 6f 62 65 79 73 |obeyline|s \obeys|
|00000230| 70 61 63 65 73 20 5c 74 | 74 20 5c 76 62 61 72 67 |paces \t|t \vbarg|
|00000240| 7d 0a 5c 64 65 66 5c 76 | 65 72 62 7b 5c 6c 65 74 |}.\def\v|erb{\let|
|00000250| 5c 64 6f 5c 6d 61 6b 65 | 6f 74 68 65 72 20 5c 64 |\do\make|other \d|
|00000260| 6f 73 70 65 63 69 61 6c | 73 7d 0a 5c 63 61 74 63 |ospecial|s}.\catc|
|00000270| 6f 64 65 60 5c 2a 3d 5c | 61 63 74 69 76 65 0a 5c |ode`\*=\|active.\|
|00000280| 64 65 66 2a 7b 5c 62 65 | 67 69 6e 67 72 6f 75 70 |def*{\be|gingroup|
|00000290| 5c 76 65 72 62 5c 74 74 | 5c 64 6f 73 74 61 72 7d |\verb\tt|\dostar}|
|000002a0| 0a 5c 64 65 66 5c 64 6f | 73 74 61 72 23 31 2a 7b |.\def\do|star#1*{|
|000002b0| 23 31 5c 65 6e 64 67 72 | 6f 75 70 7d 0a 0a 25 20 |#1\endgr|oup}..% |
|000002c0| 5c 63 65 6e 74 65 72 6c | 69 6e 65 7b 5c 62 66 20 |\centerl|ine{\bf |
|000002d0| 54 72 65 65 73 20 69 6e | 20 5c 54 65 58 7d 0a 25 |Trees in| \TeX}.%|
|000002e0| 20 5c 63 65 6e 74 65 72 | 6c 69 6e 65 7b 44 61 76 | \center|line{Dav|
|000002f0| 69 64 20 45 70 70 73 74 | 65 69 6e 3b 20 46 65 62 |id Eppst|ein; Feb|
|00000300| 72 75 61 72 79 20 36 2c | 20 31 39 38 35 7d 0a 0a |ruary 6,| 1985}..|
|00000310| 5c 62 65 67 69 6e 73 65 | 63 74 69 6f 6e 20 49 6e |\beginse|ction In|
|00000320| 74 72 6f 64 75 63 74 69 | 6f 6e 0a 0a 54 68 65 72 |troducti|on..Ther|
|00000330| 65 20 61 72 65 20 6d 61 | 6e 79 20 70 6f 73 73 69 |e are ma|ny possi|
|00000340| 62 6c 65 20 75 73 65 73 | 20 66 6f 72 20 74 72 65 |ble uses| for tre|
|00000350| 65 73 20 69 6e 20 74 79 | 70 65 73 65 74 20 74 65 |es in ty|peset te|
|00000360| 78 74 2e 20 20 54 68 65 | 20 66 6f 6c 6c 6f 77 69 |xt. The| followi|
|00000370| 6e 67 0a 74 61 78 6f 6e | 6f 6d 79 20 69 6c 6c 75 |ng.taxon|omy illu|
|00000380| 73 74 72 61 74 65 73 20 | 73 6f 6d 65 20 6f 66 20 |strates |some of |
|00000390| 74 68 65 6d 2e 0a 0a 5c | 74 72 65 65 0a 20 20 54 |them...\|tree. T|
|000003a0| 72 65 65 0a 20 20 55 73 | 65 73 0a 0a 20 20 5c 73 |ree. Us|es.. \s|
|000003b0| 75 62 74 72 65 65 0a 20 | 20 20 20 43 6f 6d 70 75 |ubtree. | Compu|
|000003c0| 74 65 72 0a 20 20 20 20 | 53 63 69 65 6e 63 65 0a |ter. |Science.|
|000003d0| 0a 20 20 20 20 5c 73 75 | 62 74 72 65 65 0a 20 20 |. \su|btree. |
|000003e0| 20 20 20 20 44 61 74 61 | 0a 20 20 20 20 20 20 53 | Data|. S|
|000003f0| 74 72 75 63 74 75 72 65 | 73 0a 20 20 20 20 20 20 |tructure|s. |
|00000400| 0a 20 20 20 20 20 20 5c | 6c 65 61 66 7b 53 65 61 |. \|leaf{Sea|
|00000410| 72 63 68 20 54 72 65 65 | 7d 0a 20 20 20 20 20 20 |rch Tree|}. |
|00000420| 5c 6c 65 61 66 7b 50 72 | 69 6f 72 69 74 79 20 51 |\leaf{Pr|iority Q|
|00000430| 75 65 75 65 7d 0a 20 20 | 20 20 5c 65 6e 64 73 75 |ueue}. | \endsu|
|00000440| 62 74 72 65 65 0a 0a 20 | 20 20 20 5c 73 75 62 74 |btree.. | \subt|
|00000450| 72 65 65 0a 20 20 20 20 | 20 20 50 61 72 73 69 6e |ree. | Parsin|
|00000460| 67 0a 0a 20 20 20 20 20 | 20 5c 6c 65 61 66 7b 50 |g.. | \leaf{P|
|00000470| 61 72 73 65 20 54 72 65 | 65 7d 0a 20 20 20 20 20 |arse Tre|e}. |
|00000480| 20 5c 6c 65 61 66 7b 53 | 79 6d 62 6f 6c 20 54 61 | \leaf{S|ymbol Ta|
|00000490| 62 6c 65 7d 0a 20 20 20 | 20 5c 65 6e 64 73 75 62 |ble}. | \endsub|
|000004a0| 74 72 65 65 0a 0a 20 20 | 20 20 5c 73 75 62 74 72 |tree.. | \subtr|
|000004b0| 65 65 0a 20 20 20 20 20 | 20 53 74 72 75 63 74 75 |ee. | Structu|
|000004c0| 72 65 64 0a 20 20 20 20 | 20 20 50 72 6f 67 72 61 |red. | Progra|
|000004d0| 6d 6d 69 6e 67 0a 20 20 | 20 20 5c 65 6e 64 73 75 |mming. | \endsu|
|000004e0| 62 74 72 65 65 0a 20 20 | 5c 65 6e 64 73 75 62 74 |btree. |\endsubt|
|000004f0| 72 65 65 0a 0a 20 20 5c | 73 75 62 74 72 65 65 0a |ree.. \|subtree.|
|00000500| 20 20 20 20 47 65 6e 65 | 61 6c 6f 67 79 0a 20 20 | Gene|alogy. |
|00000510| 20 20 5c 6c 65 61 66 7b | 41 6e 63 65 73 74 6f 72 | \leaf{|Ancestor|
|00000520| 73 7d 0a 20 20 20 20 5c | 6c 65 61 66 7b 44 65 73 |s}. \|leaf{Des|
|00000530| 63 65 6e 64 61 6e 74 73 | 7d 0a 20 20 5c 65 6e 64 |cendants|}. \end|
|00000540| 73 75 62 74 72 65 65 0a | 0a 20 20 5c 73 75 62 74 |subtree.|. \subt|
|00000550| 72 65 65 0a 20 20 20 20 | 54 61 78 6f 6e 6f 6d 69 |ree. |Taxonomi|
|00000560| 65 73 0a 20 20 20 20 5c | 6c 65 61 66 7b 54 72 65 |es. \|leaf{Tre|
|00000570| 65 20 55 73 65 73 7d 0a | 20 20 5c 65 6e 64 73 75 |e Uses}.| \endsu|
|00000580| 62 74 72 65 65 0a 5c 65 | 6e 64 74 72 65 65 0a 0a |btree.\e|ndtree..|
|00000590| 55 6e 66 6f 72 74 75 6e | 61 74 65 6c 79 20 5c 54 |Unfortun|ately \T|
|000005a0| 65 58 5c 20 70 72 6f 76 | 69 64 65 73 20 6e 6f 20 |eX\ prov|ides no |
|000005b0| 65 61 73 79 20 77 61 79 | 20 74 6f 20 74 79 70 65 |easy way| to type|
|000005c0| 73 65 74 20 73 75 63 68 | 20 74 72 65 65 73 2e 0a |set such| trees..|
|000005d0| 4f 6e 65 20 70 6f 73 73 | 69 62 6c 65 20 6d 65 74 |One poss|ible met|
|000005e0| 68 6f 64 20 69 73 20 67 | 69 76 65 6e 20 69 6e 20 |hod is g|iven in |
|000005f0| 65 78 65 72 63 69 73 65 | 20 32 32 2e 31 34 20 6f |exercise| 22.14 o|
|00000600| 66 20 74 68 65 20 5c 54 | 65 58 20 62 6f 6f 6b 3a |f the \T|eX book:|
|00000610| 20 75 73 69 6e 67 0a 5c | 54 65 58 27 73 20 61 6c | using.\|TeX's al|
|00000620| 69 67 6e 6d 65 6e 74 20 | 70 72 69 6d 69 74 69 76 |ignment |primitiv|
|00000630| 65 73 20 62 79 20 68 61 | 6e 64 2e 20 20 54 68 69 |es by ha|nd. Thi|
|00000640| 73 20 6d 65 74 68 6f 64 | 20 62 65 63 6f 6d 65 73 |s method| becomes|
|00000650| 20 76 65 72 79 20 63 6c | 75 6d 73 79 20 61 73 20 | very cl|umsy as |
|00000660| 74 68 65 0a 74 72 65 65 | 73 20 67 72 6f 77 2c 20 |the.tree|s grow, |
|00000670| 68 6f 77 65 76 65 72 2e | 20 20 41 20 6d 6f 72 65 |however.| A more|
|00000680| 20 67 65 6e 65 72 61 6c | 20 74 65 63 68 6e 69 71 | general| techniq|
|00000690| 75 65 20 69 73 20 74 6f | 20 77 72 69 74 65 20 61 |ue is to| write a|
|000006a0| 20 73 65 74 20 6f 66 20 | 74 72 65 65 0a 63 6f 6e | set of |tree.con|
|000006b0| 73 74 72 75 63 74 69 6f | 6e 20 6d 61 63 72 6f 73 |structio|n macros|
|000006c0| 3b 20 74 68 61 74 20 69 | 73 20 74 68 65 20 61 70 |; that i|s the ap|
|000006d0| 70 72 6f 61 63 68 20 74 | 61 6b 65 6e 20 69 6e 20 |proach t|aken in |
|000006e0| 74 68 69 73 20 70 61 70 | 65 72 2e 20 20 54 68 65 |this pap|er. The|
|000006f0| 0a 74 61 78 6f 6e 6f 6d | 79 20 61 62 6f 76 65 20 |.taxonom|y above |
|00000700| 77 61 73 20 74 79 70 65 | 73 65 74 20 77 69 74 68 |was type|set with|
|00000710| 20 74 68 65 20 66 6f 6c | 6c 6f 77 69 6e 67 20 69 | the fol|lowing i|
|00000720| 6e 70 75 74 3a 0a 0a 5c | 76 62 0a 5c 74 72 65 65 |nput:..\|vb.\tree|
|00000730| 0a 20 20 54 72 65 65 0a | 20 20 55 73 65 73 0a 0a |. Tree.| Uses..|
|00000740| 20 20 5c 73 75 62 74 72 | 65 65 0a 20 20 20 20 43 | \subtr|ee. C|
|00000750| 6f 6d 70 75 74 65 72 0a | 20 20 20 20 53 63 69 65 |omputer.| Scie|
|00000760| 6e 63 65 0a 0a 20 20 20 | 20 5c 73 75 62 74 72 65 |nce.. | \subtre|
|00000770| 65 0a 20 20 20 20 20 20 | 44 61 74 61 0a 20 20 20 |e. |Data. |
|00000780| 20 20 20 53 74 72 75 63 | 74 75 72 65 73 0a 0a 20 | Struc|tures.. |
|00000790| 20 20 20 20 20 5c 6c 65 | 61 66 7b 53 65 61 72 63 | \le|af{Searc|
|000007a0| 68 20 54 72 65 65 7d 0a | 20 20 20 20 20 20 5c 6c |h Tree}.| \l|
|000007b0| 65 61 66 7b 50 72 69 6f | 72 69 74 79 20 51 75 65 |eaf{Prio|rity Que|
|000007c0| 75 65 7d 0a 20 20 20 20 | 5c 65 6e 64 73 75 62 74 |ue}. |\endsubt|
|000007d0| 72 65 65 0a 20 20 20 20 | 2e 2e 2e 0a 20 20 5c 65 |ree. |.... \e|
|000007e0| 6e 64 73 75 62 74 72 65 | 65 0a 20 20 2e 2e 2e 0a |ndsubtre|e. ....|
|000007f0| 5c 65 6e 64 74 72 65 65 | 0a 5c 65 6e 64 76 62 0a |\endtree|.\endvb.|
|00000800| 0a 49 74 20 74 75 72 6e | 73 20 6f 75 74 20 74 68 |.It turn|s out th|
|00000810| 61 74 20 5c 54 65 58 27 | 73 20 61 6c 69 67 6e 6d |at \TeX'|s alignm|
|00000820| 65 6e 74 20 70 72 69 6d | 69 74 69 76 65 73 20 61 |ent prim|itives a|
|00000830| 72 65 20 6e 6f 74 20 76 | 65 72 79 20 77 65 6c 6c |re not v|ery well|
|00000840| 20 73 75 69 74 65 64 20 | 74 6f 0a 61 75 74 6f 6d | suited |to.autom|
|00000850| 61 74 69 63 20 67 65 6e | 65 72 61 74 69 6f 6e 20 |atic gen|eration |
|00000860| 6f 66 20 74 72 65 65 73 | 2e 20 20 54 68 65 20 6c |of trees|. The l|
|00000870| 65 66 74 20 65 64 67 65 | 73 20 6f 66 20 74 68 65 |eft edge|s of the|
|00000880| 20 74 72 65 65 73 20 61 | 74 20 65 61 63 68 0a 6c | trees a|t each.l|
|00000890| 65 76 65 6c 20 63 61 6e | 20 65 61 73 69 6c 79 20 |evel can| easily |
|000008a0| 62 65 20 6d 61 64 65 20 | 74 6f 20 6c 69 6e 65 20 |be made |to line |
|000008b0| 75 70 2c 20 62 75 74 20 | 69 74 20 69 73 20 64 69 |up, but |it is di|
|000008c0| 66 66 69 63 75 6c 74 20 | 74 6f 20 63 65 6e 74 65 |fficult |to cente|
|000008d0| 72 0a 6c 69 6e 65 73 20 | 6f 66 20 74 65 78 74 20 |r.lines |of text |
|000008e0| 66 6f 72 20 74 68 65 20 | 72 6f 6f 74 20 6f 66 20 |for the |root of |
|000008f0| 61 20 74 72 65 65 20 69 | 6e 20 76 65 72 74 69 63 |a tree i|n vertic|
|00000900| 61 6c 20 72 65 6c 61 74 | 69 6f 6e 20 74 6f 20 69 |al relat|ion to i|
|00000910| 74 73 20 73 75 62 74 72 | 65 65 73 2e 0a 49 6e 73 |ts subtr|ees..Ins|
|00000920| 74 65 61 64 2c 20 74 68 | 65 20 6d 61 63 72 6f 73 |tead, th|e macros|
|00000930| 20 64 65 73 63 72 69 62 | 65 64 20 68 65 72 65 20 | describ|ed here |
|00000940| 63 6f 6e 73 74 72 75 63 | 74 20 74 72 65 65 73 20 |construc|t trees |
|00000950| 66 72 6f 6d 20 62 6f 78 | 65 73 20 61 6e 64 0a 67 |from box|es and.g|
|00000960| 6c 75 65 2c 20 64 6f 69 | 6e 67 20 74 68 65 20 61 |lue, doi|ng the a|
|00000970| 6c 69 67 6e 6d 65 6e 74 | 20 74 68 65 6d 73 65 6c |lignment| themsel|
|00000980| 76 65 73 2e 20 20 54 68 | 69 73 20 69 73 20 6e 6f |ves. Th|is is no|
|00000990| 74 20 71 75 69 74 65 20 | 61 73 20 73 69 6d 70 6c |t quite |as simpl|
|000009a0| 65 20 61 73 0a 69 74 20 | 73 6f 75 6e 64 73 2d 2d |e as.it |sounds--|
|000009b0| 2d 69 74 20 77 6f 75 6c | 64 20 62 65 20 69 6e 63 |-it woul|d be inc|
|000009c0| 6f 72 72 65 63 74 20 74 | 6f 20 73 65 74 20 73 75 |orrect t|o set su|
|000009d0| 62 74 72 65 65 73 20 69 | 6e 64 65 70 65 6e 64 65 |btrees i|ndepende|
|000009e0| 6e 74 6c 79 20 6f 66 0a | 65 61 63 68 20 6f 74 68 |ntly of.|each oth|
|000009f0| 65 72 2c 20 62 65 63 61 | 75 73 65 20 74 68 65 6e |er, beca|use then|
|00000a00| 20 74 68 65 20 65 64 67 | 65 73 20 77 6f 75 6c 64 | the edg|es would|
|00000a10| 20 6e 6f 74 20 6c 69 6e | 65 20 75 70 2e 20 20 46 | not lin|e up. F|
|00000a20| 6f 72 20 69 6e 73 74 61 | 6e 63 65 2c 0a 69 6e 20 |or insta|nce,.in |
|00000a30| 74 68 65 20 74 61 78 6f | 6e 6f 6d 79 20 61 62 6f |the taxo|nomy abo|
|00000a40| 76 65 2c 20 74 68 65 20 | 74 65 78 74 20 60 60 53 |ve, the |text ``S|
|00000a50| 65 61 72 63 68 20 54 72 | 65 65 27 27 20 73 68 6f |earch Tr|ee'' sho|
|00000a60| 75 6c 64 20 6c 69 6e 65 | 20 75 70 0a 77 69 74 68 |uld line| up.with|
|00000a70| 20 60 60 50 61 72 73 65 | 20 54 72 65 65 27 27 2e | ``Parse| Tree''.|
|00000a80| 20 20 41 20 6f 6e 65 2d | 70 61 73 73 20 61 6c 67 | A one-|pass alg|
|00000a90| 6f 72 69 74 68 6d 20 77 | 6f 75 6c 64 20 73 65 74 |orithm w|ould set|
|00000aa0| 20 74 68 65 20 66 6f 72 | 6d 65 72 0a 73 6f 6d 65 | the for|mer.some|
|00000ab0| 77 68 61 74 20 74 6f 20 | 74 68 65 20 72 69 67 68 |what to |the righ|
|00000ac0| 74 20 6f 66 20 74 68 65 | 20 6c 61 74 74 65 72 2e |t of the| latter.|
|00000ad0| 0a 0a 54 6f 20 73 6f 6c | 76 65 20 74 68 69 73 20 |..To sol|ve this |
|00000ae0| 70 72 6f 62 6c 65 6d 2c | 20 74 68 65 20 6d 61 63 |problem,| the mac|
|00000af0| 72 6f 73 20 64 65 73 63 | 72 69 62 65 64 20 68 65 |ros desc|ribed he|
|00000b00| 72 65 20 73 65 74 20 61 | 20 74 72 65 65 20 75 73 |re set a| tree us|
|00000b10| 69 6e 67 0a 74 68 72 65 | 65 20 70 61 73 73 65 73 |ing.thre|e passes|
|00000b20| 2e 20 20 46 69 72 73 74 | 2c 20 61 20 64 61 74 61 |. First|, a data|
|00000b30| 20 73 74 72 75 63 74 75 | 72 65 20 69 73 20 62 75 | structu|re is bu|
|00000b40| 69 6c 74 20 75 70 20 66 | 72 6f 6d 20 74 68 65 20 |ilt up f|rom the |
|00000b50| 74 72 65 65 0a 64 65 66 | 69 6e 69 74 69 6f 6e 2e |tree.def|inition.|
|00000b60| 20 20 53 65 63 6f 6e 64 | 2c 20 74 68 61 74 20 64 | Second|, that d|
|00000b70| 61 74 61 20 73 74 72 75 | 63 74 75 72 65 20 69 73 |ata stru|cture is|
|00000b80| 20 75 73 65 64 20 74 6f | 20 63 61 6c 63 75 6c 61 | used to| calcula|
|00000b90| 74 65 20 74 68 65 0a 77 | 69 64 74 68 20 6f 66 20 |te the.w|idth of |
|00000ba0| 65 61 63 68 20 6c 65 76 | 65 6c 20 6f 66 20 74 68 |each lev|el of th|
|00000bb0| 65 20 74 72 65 65 2c 20 | 73 6f 20 74 68 61 74 20 |e tree, |so that |
|00000bc0| 74 68 65 20 73 75 62 74 | 72 65 65 73 20 63 61 6e |the subt|rees can|
|00000bd0| 20 62 65 20 61 6c 69 67 | 6e 65 64 20 77 69 74 68 | be alig|ned with|
|00000be0| 20 65 61 63 68 0a 6f 74 | 68 65 72 2e 20 20 46 69 | each.ot|her. Fi|
|00000bf0| 6e 61 6c 6c 79 2c 20 74 | 68 65 20 64 61 74 61 20 |nally, t|he data |
|00000c00| 73 74 72 75 63 74 75 72 | 65 20 61 6e 64 20 74 68 |structur|e and th|
|00000c10| 65 20 63 61 6c 63 75 6c | 61 74 65 64 20 6c 69 73 |e calcul|ated lis|
|00000c20| 74 20 6f 66 20 77 69 64 | 74 68 73 0a 61 72 65 20 |t of wid|ths.are |
|00000c30| 75 73 65 64 20 74 6f 20 | 73 65 74 20 74 68 65 20 |used to |set the |
|00000c40| 73 79 73 74 65 6d 20 6f | 66 20 62 6f 78 65 73 2c |system o|f boxes,|
|00000c50| 20 67 6c 75 65 2c 20 61 | 6e 64 20 72 75 6c 65 73 | glue, a|nd rules|
|00000c60| 20 74 68 61 74 20 6d 61 | 6b 65 20 75 70 20 74 68 | that ma|ke up th|
|00000c70| 65 20 74 72 65 65 2e 0a | 0c 0a 5c 62 65 67 69 6e |e tree..|..\begin|
|00000c80| 73 65 63 74 69 6f 6e 20 | 50 61 73 73 20 31 3a 20 |section |Pass 1: |
|00000c90| 49 6e 74 65 72 6e 61 6c | 20 73 74 6f 72 61 67 65 |Internal| storage|
|00000ca0| 20 6f 66 20 74 68 65 20 | 74 72 65 65 20 73 74 72 | of the |tree str|
|00000cb0| 75 63 74 75 72 65 0a 0a | 54 68 65 72 65 20 61 72 |ucture..|There ar|
|00000cc0| 65 20 73 65 76 65 72 61 | 6c 20 70 6f 73 73 69 62 |e severa|l possib|
|00000cd0| 6c 65 20 77 61 79 73 20 | 74 6f 20 73 74 6f 72 65 |le ways |to store|
|00000ce0| 20 74 68 65 20 73 74 72 | 75 63 74 75 72 65 20 64 | the str|ucture d|
|00000cf0| 65 66 69 6e 65 64 20 62 | 79 20 74 68 65 0a 74 72 |efined b|y the.tr|
|00000d00| 65 65 20 6d 61 63 72 6f | 73 2e 20 20 53 69 6e 63 |ee macro|s. Sinc|
|00000d10| 65 20 77 65 20 77 61 6e | 74 20 74 6f 20 72 65 6d |e we wan|t to rem|
|00000d20| 65 6d 62 65 72 20 61 6c | 72 65 61 64 79 2d 73 65 |ember al|ready-se|
|00000d30| 74 20 74 65 78 74 20 28 | 74 68 65 20 77 6f 72 64 |t text (|the word|
|00000d40| 73 20 61 74 0a 74 68 65 | 20 72 6f 6f 74 73 20 6f |s at.the| roots o|
|00000d50| 66 20 65 61 63 68 20 74 | 72 65 65 20 6f 66 20 73 |f each t|ree of s|
|00000d60| 75 62 74 72 65 65 29 20 | 77 65 20 77 69 6c 6c 20 |ubtree) |we will |
|00000d70| 75 73 65 20 61 20 6e 65 | 73 74 65 64 20 73 74 72 |use a ne|sted str|
|00000d80| 75 63 74 75 72 65 20 6f | 66 20 62 6f 78 65 73 2e |ucture o|f boxes.|
|00000d90| 0a 45 61 63 68 20 73 75 | 62 74 72 65 65 20 69 73 |.Each su|btree is|
|00000da0| 20 73 74 6f 72 65 64 20 | 69 6e 20 61 6e 20 2a 5c | stored |in an *\|
|00000db0| 68 62 6f 78 2a 2c 20 73 | 6f 20 74 68 61 74 20 70 |hbox*, s|o that p|
|00000dc0| 69 65 63 65 73 20 6f 66 | 20 69 74 20 63 61 6e 20 |ieces of| it can |
|00000dd0| 62 65 20 70 75 6c 6c 65 | 64 0a 6f 66 66 20 65 61 |be pulle|d.off ea|
|00000de0| 73 69 6c 79 20 75 73 69 | 6e 67 20 2a 5c 6c 61 73 |sily usi|ng *\las|
|00000df0| 74 62 6f 78 2a 20 61 6e | 64 20 2a 5c 75 6e 73 6b |tbox* an|d *\unsk|
|00000e00| 69 70 2a 2e 20 20 54 6f | 20 64 69 73 74 69 6e 67 |ip*. To| disting|
|00000e10| 75 69 73 68 20 69 74 20 | 66 72 6f 6d 0a 61 6e 6f |uish it |from.ano|
|00000e20| 74 68 65 72 20 73 75 62 | 74 72 65 65 2c 20 74 68 |ther sub|tree, th|
|00000e30| 65 20 74 65 78 74 20 61 | 74 20 74 68 65 20 72 6f |e text a|t the ro|
|00000e40| 6f 74 20 6f 66 20 61 20 | 73 75 62 74 72 65 65 20 |ot of a |subtree |
|00000e50| 69 73 20 73 74 6f 72 65 | 64 20 69 6e 20 61 20 2a |is store|d in a *|
|00000e60| 5c 76 62 6f 78 2a 2e 0a | 54 6f 20 6d 61 6b 65 20 |\vbox*..|To make |
|00000e70| 74 68 69 73 20 63 6c 65 | 61 72 65 72 2c 20 6c 65 |this cle|arer, le|
|00000e80| 74 20 75 73 20 72 65 74 | 75 72 6e 20 74 6f 20 6f |t us ret|urn to o|
|00000e90| 75 72 20 6f 72 69 67 69 | 6e 61 6c 20 74 61 78 6f |ur origi|nal taxo|
|00000ea0| 6e 6f 6d 79 2e 0a 57 65 | 20 73 68 61 6c 6c 20 69 |nomy..We| shall i|
|00000eb0| 67 6e 6f 72 65 20 66 6f | 72 20 74 68 65 20 6d 6f |gnore fo|r the mo|
|00000ec0| 6d 65 6e 74 0a 74 68 65 | 20 64 65 74 61 69 6c 73 |ment.the| details|
|00000ed0| 20 69 6e 73 69 64 65 20 | 74 68 65 20 74 65 78 74 | inside |the text|
|00000ee0| 20 2a 5c 76 62 6f 78 2a | 65 73 2c 20 61 6e 64 20 | *\vbox*|es, and |
|00000ef0| 74 68 65 20 67 6c 75 65 | 20 62 65 74 77 65 65 6e |the glue| between|
|00000f00| 20 62 6f 78 65 73 2e 0a | 41 66 74 65 72 20 74 68 | boxes..|After th|
|00000f10| 65 20 66 69 72 73 74 20 | 70 61 73 73 2c 20 74 68 |e first |pass, th|
|00000f20| 65 20 74 72 65 65 20 61 | 73 20 61 20 77 68 6f 6c |e tree a|s a whol|
|00000f30| 65 20 77 6f 75 6c 64 20 | 6c 6f 6f 6b 20 6c 69 6b |e would |look lik|
|00000f40| 65 20 74 68 65 0a 66 6f | 6c 6c 6f 77 69 6e 67 20 |e the.fo|llowing |
|00000f50| 73 65 74 20 6f 66 20 62 | 6f 78 65 73 3a 0a 0a 5c |set of b|oxes:..\|
|00000f60| 76 62 0a 5c 68 62 6f 78 | 7b 5c 76 62 6f 78 7b 54 |vb.\hbox|{\vbox{T|
|00000f70| 72 65 65 20 55 73 65 73 | 7d 0a 20 20 5c 68 62 6f |ree Uses|}. \hbo|
|00000f80| 78 7b 5c 76 62 6f 78 7b | 43 6f 6d 70 75 74 65 72 |x{\vbox{|Computer|
|00000f90| 20 53 63 69 65 6e 63 65 | 7d 0a 20 20 20 20 5c 68 | Science|}. \h|
|00000fa0| 62 6f 78 7b 5c 76 62 6f | 78 7b 44 61 74 61 20 53 |box{\vbo|x{Data S|
|00000fb0| 74 72 75 63 74 75 72 65 | 73 7d 0a 20 20 20 20 20 |tructure|s}. |
|00000fc0| 20 5c 68 62 6f 78 7b 5c | 76 62 6f 78 7b 53 65 61 | \hbox{\|vbox{Sea|
|00000fd0| 72 63 68 20 54 72 65 65 | 7d 7d 0a 20 20 20 20 20 |rch Tree|}}. |
|00000fe0| 20 5c 68 62 6f 78 7b 5c | 76 62 6f 78 7b 50 72 69 | \hbox{\|vbox{Pri|
|00000ff0| 6f 72 69 74 79 20 51 75 | 65 75 65 7d 7d 7d 0a 20 |ority Qu|eue}}}. |
|00001000| 20 20 20 2e 2e 2e 7d 0a | 20 20 2e 2e 2e 7d 0a 5c | ...}.| ...}.\|
|00001010| 65 6e 64 76 62 0a 0a 4e | 6f 77 20 77 65 20 63 61 |endvb..N|ow we ca|
|00001020| 6e 20 62 65 67 69 6e 20 | 64 65 66 69 6e 69 6e 67 |n begin |defining|
|00001030| 20 74 68 65 20 74 72 65 | 65 20 6d 61 63 72 6f 73 | the tre|e macros|
|00001040| 2e 20 20 57 65 20 73 74 | 61 72 74 20 64 65 66 69 |. We st|art defi|
|00001050| 6e 69 6e 67 20 61 20 74 | 72 65 65 0a 77 69 74 68 |ning a t|ree.with|
|00001060| 20 74 68 65 20 2a 5c 74 | 72 65 65 2a 20 6d 61 63 | the *\t|ree* mac|
|00001070| 72 6f 3b 20 74 68 69 73 | 20 6d 65 72 65 6c 79 20 |ro; this| merely |
|00001080| 73 65 74 73 20 75 70 20 | 74 68 65 20 61 73 73 69 |sets up |the assi|
|00001090| 67 6e 6d 65 6e 74 20 6f | 66 20 74 68 65 0a 62 6f |gnment o|f the.bo|
|000010a0| 78 65 64 20 74 72 65 65 | 20 73 74 72 75 63 74 75 |xed tree| structu|
|000010b0| 72 65 20 69 6e 74 6f 20 | 61 20 62 6f 78 20 63 61 |re into |a box ca|
|000010c0| 6c 6c 65 64 20 2a 5c 74 | 72 65 65 62 6f 78 2a 2e |lled *\t|reebox*.|
|000010d0| 20 20 53 74 61 72 74 69 | 6e 67 20 61 20 73 75 62 | Starti|ng a sub|
|000010e0| 74 72 65 65 0a 69 73 20 | 73 69 6d 69 6c 61 72 2c |tree.is |similar,|
|000010f0| 20 62 75 74 20 74 68 65 | 72 65 20 69 73 20 6e 6f | but the|re is no|
|00001100| 20 61 73 73 69 67 6e 6d | 65 6e 74 3b 20 61 6c 73 | assignm|ent; als|
|00001110| 6f 2c 20 69 66 20 69 74 | 20 69 73 20 74 68 65 20 |o, if it| is the |
|00001120| 66 69 72 73 74 0a 2a 5c | 73 75 62 74 72 65 65 2a |first.*\|subtree*|
|00001130| 20 6f 66 20 69 74 73 20 | 74 72 65 65 20 6f 72 20 | of its |tree or |
|00001140| 73 75 62 74 72 65 65 2c | 20 77 65 20 6d 75 73 74 |subtree,| we must|
|00001150| 20 73 74 6f 70 20 6d 61 | 6b 69 6e 67 20 74 68 65 | stop ma|king the|
|00001160| 20 2a 5c 76 62 6f 78 2a | 0a 63 6f 6e 74 61 69 6e | *\vbox*|.contain|
|00001170| 69 6e 67 20 74 68 65 20 | 72 6f 6f 74 20 74 65 78 |ing the |root tex|
|00001180| 74 2e 20 20 41 20 6c 65 | 61 66 20 69 73 20 6d 65 |t. A le|af is me|
|00001190| 72 65 6c 79 20 61 20 73 | 75 62 74 72 65 65 20 77 |rely a s|ubtree w|
|000011a0| 69 74 68 6f 75 74 20 61 | 6e 79 0a 73 75 62 2d 73 |ithout a|ny.sub-s|
|000011b0| 75 62 74 72 65 65 73 2e | 0a 0a 5c 76 62 0a 5c 6e |ubtrees.|..\vb.\n|
|000011c0| 65 77 62 6f 78 5c 74 72 | 65 65 62 6f 78 0a 5c 64 |ewbox\tr|eebox.\d|
|000011d0| 65 66 5c 74 72 65 65 7b | 5c 67 6c 6f 62 61 6c 5c |ef\tree{|\global\|
|000011e0| 73 65 74 62 6f 78 5c 74 | 72 65 65 62 6f 78 3d 5c |setbox\t|reebox=\|
|000011f0| 62 6f 78 74 72 65 65 7d | 0a 5c 64 65 66 5c 73 75 |boxtree}|.\def\su|
|00001200| 62 74 72 65 65 7b 5c 65 | 74 74 65 78 74 20 5c 62 |btree{\e|ttext \b|
|00001210| 6f 78 74 72 65 65 7d 0a | 5c 64 65 66 5c 6c 65 61 |oxtree}.|\def\lea|
|00001220| 66 23 31 7b 5c 73 75 62 | 74 72 65 65 23 31 5c 65 |f#1{\sub|tree#1\e|
|00001230| 6e 64 73 75 62 74 72 65 | 65 7d 0a 5c 65 6e 64 76 |ndsubtre|e}.\endv|
|00001240| 62 0a 0a 46 69 6e 69 73 | 68 69 6e 67 20 61 20 73 |b..Finis|hing a s|
|00001250| 75 62 74 72 65 65 20 6d | 65 72 65 6c 79 20 69 6e |ubtree m|erely in|
|00001260| 76 6f 6c 76 65 73 20 66 | 69 72 73 74 20 6d 61 6b |volves f|irst mak|
|00001270| 69 6e 67 20 73 75 72 65 | 20 74 68 65 20 72 6f 6f |ing sure| the roo|
|00001280| 74 20 74 65 78 74 20 69 | 73 0a 63 6f 6d 70 6c 65 |t text i|s.comple|
|00001290| 74 65 2c 20 61 6e 64 20 | 73 65 63 6f 6e 64 0a 63 |te, and |second.c|
|000012a0| 6f 6d 70 6c 65 74 69 6e | 67 20 74 68 65 20 62 6f |ompletin|g the bo|
|000012b0| 78 20 74 68 61 74 20 77 | 61 73 20 73 74 61 72 74 |x that w|as start|
|000012c0| 65 64 20 69 6e 20 74 68 | 65 20 65 78 70 61 6e 73 |ed in th|e expans|
|000012d0| 69 6f 6e 20 6f 66 20 2a | 5c 73 75 62 74 72 65 65 |ion of *|\subtree|
|000012e0| 2a 2e 0a 46 69 6e 69 73 | 68 69 6e 67 20 61 20 77 |*..Finis|hing a w|
|000012f0| 68 6f 6c 65 20 74 72 65 | 65 20 69 6e 76 6f 6c 76 |hole tre|e involv|
|00001300| 65 73 20 62 6f 74 68 20 | 6f 66 20 74 68 6f 73 65 |es both |of those|
|00001310| 20 73 74 65 70 73 2c 20 | 62 75 74 20 74 68 65 6e | steps, |but then|
|00001320| 20 61 66 74 65 72 20 74 | 68 65 0a 62 6f 78 20 69 | after t|he.box i|
|00001330| 73 20 63 6f 6d 70 6c 65 | 74 65 64 20 74 68 65 20 |s comple|ted the |
|00001340| 72 65 6d 61 69 6e 69 6e | 67 20 74 77 6f 20 70 61 |remainin|g two pa|
|00001350| 73 73 65 73 20 6d 75 73 | 74 20 62 65 20 72 75 6e |sses mus|t be run|
|00001360| 2e 0a 0a 5c 76 62 0a 5c | 64 65 66 5c 65 6e 64 73 |...\vb.\|def\ends|
|00001370| 75 62 74 72 65 65 7b 5c | 65 74 74 65 78 74 20 5c |ubtree{\|ettext \|
|00001380| 65 67 72 6f 75 70 7d 0a | 5c 64 65 66 5c 65 6e 64 |egroup}.|\def\end|
|00001390| 74 72 65 65 7b 5c 65 6e | 64 73 75 62 74 72 65 65 |tree{\en|dsubtree|
|000013a0| 20 5c 73 65 74 74 72 65 | 65 73 69 7a 65 73 20 5c | \settre|esizes \|
|000013b0| 74 79 70 65 73 65 74 74 | 72 65 65 7d 0a 5c 65 6e |typesett|ree}.\en|
|000013c0| 64 76 62 0a 0a 0a 4e 6f | 77 20 61 6c 6c 20 74 68 |dvb...No|w all th|
|000013d0| 61 74 20 72 65 6d 61 69 | 6e 73 20 74 6f 20 62 65 |at remai|ns to be|
|000013e0| 20 64 65 66 69 6e 65 64 | 20 6f 66 20 74 68 65 20 | defined| of the |
|000013f0| 66 69 72 73 74 20 70 61 | 73 73 20 69 73 20 74 68 |first pa|ss is th|
|00001400| 65 20 63 6f 6e 73 74 72 | 75 63 74 69 6f 6e 0a 6f |e constr|uction.o|
|00001410| 66 20 74 68 65 20 2a 5c | 76 62 6f 78 2a 20 63 6f |f the *\|vbox* co|
|00001420| 6e 74 61 69 6e 69 6e 67 | 20 74 68 65 20 72 6f 6f |ntaining| the roo|
|00001430| 74 20 74 65 78 74 2e 20 | 20 54 68 65 20 64 69 66 |t text. | The dif|
|00001440| 66 69 63 75 6c 74 79 20 | 68 65 72 65 20 69 73 0a |ficulty |here is.|
|00001450| 63 6f 6e 76 69 6e 63 69 | 6e 67 20 5c 54 65 58 5c |convinci|ng \TeX\|
|00001460| 20 74 6f 20 6d 61 6b 65 | 20 74 68 65 20 2a 5c 76 | to make| the *\v|
|00001470| 62 6f 78 2a 20 6f 6e 6c | 79 20 61 73 20 77 69 64 |box* onl|y as wid|
|00001480| 65 20 61 73 20 74 68 65 | 20 77 69 64 65 73 74 20 |e as the| widest |
|00001490| 6c 69 6e 65 0a 6f 66 20 | 74 65 78 74 2c 20 72 61 |line.of |text, ra|
|000014a0| 74 68 65 72 20 74 68 61 | 6e 20 74 68 65 20 77 69 |ther tha|n the wi|
|000014b0| 64 74 68 20 6f 66 20 74 | 68 65 20 65 6e 74 69 72 |dth of t|he entir|
|000014c0| 65 20 70 61 67 65 2e 20 | 20 4f 6e 65 20 73 6f 6c |e page. | One sol|
|000014d0| 75 74 69 6f 6e 20 69 73 | 20 74 6f 0a 70 75 74 20 |ution is| to.put |
|000014e0| 74 68 65 20 74 65 78 74 | 20 69 6e 20 61 6e 20 2a |the text| in an *|
|000014f0| 5c 68 61 6c 69 67 6e 2a | 2c 20 77 69 74 68 20 2a |\halign*|, with *|
|00001500| 5c 63 72 63 72 2a 20 69 | 6d 70 6c 69 63 69 74 20 |\crcr* i|mplicit |
|00001510| 61 74 20 74 68 65 20 65 | 6e 64 20 6f 66 20 65 61 |at the e|nd of ea|
|00001520| 63 68 20 6c 69 6e 65 2e | 0a 54 68 65 20 2a 5c 69 |ch line.|.The *\i|
|00001530| 66 74 72 65 65 74 65 78 | 74 2a 20 74 65 73 74 20 |ftreetex|t* test |
|00001540| 69 73 20 75 73 65 64 20 | 74 6f 20 74 65 6c 6c 20 |is used |to tell |
|00001550| 77 68 65 74 68 65 72 20 | 77 65 20 61 72 65 20 73 |whether |we are s|
|00001560| 74 69 6c 6c 20 69 6e 73 | 69 64 65 20 74 68 65 0a |till ins|ide the.|
|00001570| 2a 5c 68 61 6c 69 67 6e | 2a 20 61 6e 64 20 2a 5c |*\halign|* and *\|
|00001580| 76 62 6f 78 2a 2c 20 73 | 6f 20 74 68 61 74 20 2a |vbox*, s|o that *|
|00001590| 5c 65 74 74 65 78 74 2a | 20 63 61 6e 20 74 65 6c |\ettext*| can tel|
|000015a0| 6c 20 77 68 65 74 68 65 | 72 20 69 74 20 73 68 6f |l whethe|r it sho|
|000015b0| 75 6c 64 20 64 6f 0a 61 | 6e 79 74 68 69 6e 67 2e |uld do.a|nything.|
|000015c0| 20 20 49 74 20 69 73 20 | 67 6c 6f 62 61 6c 6c 79 | It is |globally|
|000015d0| 20 66 61 6c 73 65 2c 20 | 62 75 74 20 77 69 74 68 | false, |but with|
|000015e0| 69 6e 20 74 68 65 20 2a | 5c 76 62 6f 78 2a 20 69 |in the *|\vbox* i|
|000015f0| 74 20 67 65 74 73 20 73 | 65 74 20 74 6f 20 74 72 |t gets s|et to tr|
|00001600| 75 65 2e 0a 0a 5c 76 62 | 0a 5c 6e 65 77 69 66 5c |ue...\vb|.\newif\|
|00001610| 69 66 74 72 65 65 74 65 | 78 74 5c 74 72 65 65 74 |iftreete|xt\treet|
|00001620| 65 78 74 66 61 6c 73 65 | 20 20 20 20 20 20 20 20 |extfalse| |
|00001630| 20 25 20 57 68 65 74 68 | 65 72 20 73 74 69 6c 6c | % Wheth|er still|
|00001640| 20 61 6c 69 67 6e 69 6e | 67 20 74 65 78 74 0a 5c | alignin|g text.\|
|00001650| 64 65 66 5c 62 6f 78 74 | 72 65 65 7b 5c 68 62 6f |def\boxt|ree{\hbo|
|00001660| 78 5c 62 67 72 6f 75 70 | 20 20 20 20 20 20 20 20 |x\bgroup| |
|00001670| 20 20 20 20 20 20 20 25 | 20 53 74 61 72 74 20 6f | %| Start o|
|00001680| 75 74 65 72 20 62 6f 78 | 20 6f 66 20 74 72 65 65 |uter box| of tree|
|00001690| 20 6f 72 20 73 75 62 74 | 72 65 65 0a 20 20 5c 62 | or subt|ree. \b|
|000016a0| 61 73 65 6c 69 6e 65 73 | 6b 69 70 20 32 2e 35 65 |aselines|kip 2.5e|
|000016b0| 78 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |x | |
|000016c0| 20 20 20 20 25 20 4e 61 | 72 72 6f 77 20 6c 69 6e | % Na|rrow lin|
|000016d0| 65 20 73 70 61 63 69 6e | 67 20 73 6c 69 67 68 74 |e spacin|g slight|
|000016e0| 6c 79 0a 20 20 5c 74 61 | 62 73 6b 69 70 20 30 70 |ly. \ta|bskip 0p|
|000016f0| 74 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |t | |
|00001700| 20 20 20 20 20 20 20 20 | 20 20 20 25 20 4e 6f 20 | | % No |
|00001710| 73 70 75 72 69 6f 75 73 | 20 67 6c 75 65 20 69 6e |spurious| glue in|
|00001720| 20 61 6c 69 67 6e 6d 65 | 6e 74 0a 20 20 5c 76 62 | alignme|nt. \vb|
|00001730| 6f 78 5c 62 67 72 6f 75 | 70 20 20 20 20 20 20 20 |ox\bgrou|p |
|00001740| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00001750| 20 20 20 25 20 53 74 61 | 72 74 20 69 6e 6e 65 72 | % Sta|rt inner|
|00001760| 20 74 65 78 74 20 5c 76 | 62 6f 78 0a 20 20 5c 74 | text \v|box. \t|
|00001770| 72 65 65 74 65 78 74 74 | 72 75 65 20 20 20 20 20 |reetextt|rue |
|00001780| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00001790| 20 20 20 20 25 20 52 65 | 6d 65 6d 62 65 72 20 66 | % Re|member f|
|000017a0| 6f 72 20 5c 65 74 74 65 | 78 74 0a 20 20 5c 6c 65 |or \ette|xt. \le|
|000017b0| 74 5c 70 61 72 5c 63 72 | 63 72 20 5c 6f 62 65 79 |t\par\cr|cr \obey|
|000017c0| 6c 69 6e 65 73 20 20 20 | 20 20 20 20 20 20 20 20 |lines | |
|000017d0| 20 20 20 25 20 4e 65 77 | 20 6c 69 6e 65 20 62 72 | % New| line br|
|000017e0| 65 61 6b 73 20 77 69 74 | 68 6f 75 74 20 65 78 70 |eaks wit|hout exp|
|000017f0| 6c 69 63 69 74 20 5c 63 | 72 0a 20 20 5c 68 61 6c |licit \c|r. \hal|
|00001800| 69 67 6e 5c 62 67 72 6f | 75 70 23 23 5c 68 66 69 |ign\bgro|up##\hfi|
|00001810| 6c 5c 63 72 7d 20 20 20 | 20 20 20 20 20 20 20 20 |l\cr} | |
|00001820| 20 20 25 20 53 74 61 72 | 74 20 61 6c 69 67 6e 6d | % Star|t alignm|
|00001830| 65 6e 74 20 77 69 74 68 | 20 73 69 6d 70 6c 65 20 |ent with| simple |
|00001840| 74 65 6d 70 6c 61 74 65 | 0a 5c 64 65 66 5c 65 74 |template|.\def\et|
|00001850| 74 65 78 74 7b 5c 69 66 | 74 72 65 65 74 65 78 74 |text{\if|treetext|
|00001860| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00001870| 20 25 20 41 72 65 20 77 | 65 20 73 74 69 6c 6c 20 | % Are w|e still |
|00001880| 69 6e 20 69 6e 6e 65 72 | 20 74 65 78 74 20 5c 76 |in inner| text \v|
|00001890| 62 6f 78 3f 0a 20 20 5c | 63 72 63 72 5c 65 67 72 |box?. \|crcr\egr|
|000018a0| 6f 75 70 20 5c 65 67 72 | 6f 75 70 20 5c 66 69 7d |oup \egr|oup \fi}|
|000018b0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 25 20 59 | | % Y|
|000018c0| 65 73 2c 20 65 6e 64 20 | 61 6c 69 67 6e 6d 65 6e |es, end |alignmen|
|000018d0| 74 20 61 6e 64 20 62 6f | 78 0a 5c 65 6e 64 76 62 |t and bo|x.\endvb|
|000018e0| 0a 0c 0a 5c 62 65 67 69 | 6e 73 65 63 74 69 6f 6e |...\begi|nsection|
|000018f0| 20 50 61 73 73 20 32 3a | 20 43 61 6c 63 75 6c 61 | Pass 2:| Calcula|
|00001900| 74 69 6f 6e 20 6f 66 20 | 77 69 64 74 68 73 20 61 |tion of |widths a|
|00001910| 74 20 65 61 63 68 20 6c | 65 76 65 6c 0a 0a 48 65 |t each l|evel..He|
|00001920| 72 65 20 77 65 20 63 61 | 6c 63 75 6c 61 74 65 20 |re we ca|lculate |
|00001930| 61 20 6c 69 73 74 20 6f | 66 20 74 68 65 20 64 69 |a list o|f the di|
|00001940| 6d 65 6e 73 69 6f 6e 73 | 20 6f 66 20 65 61 63 68 |mensions| of each|
|00001950| 20 6c 65 76 65 6c 20 6f | 66 20 74 68 65 20 74 72 | level o|f the tr|
|00001960| 65 65 3b 0a 74 68 61 74 | 20 69 73 2c 20 74 68 65 |ee;.that| is, the|
|00001970| 20 77 69 64 74 68 73 20 | 6f 66 20 74 68 65 20 77 | widths |of the w|
|00001980| 69 64 65 73 74 20 2a 5c | 76 62 6f 78 2a 20 61 74 |idest *\|vbox* at|
|00001990| 20 65 61 63 68 20 6c 65 | 76 65 6c 2e 0a 54 6f 20 | each le|vel..To |
|000019a0| 64 6f 20 74 68 69 73 2c | 20 77 65 20 6e 65 65 64 |do this,| we need|
|000019b0| 20 74 6f 20 62 65 20 61 | 62 6c 65 20 74 6f 20 6d | to be a|ble to m|
|000019c0| 61 69 6e 74 61 69 6e 20 | 6c 69 73 74 73 20 6f 66 |aintain |lists of|
|000019d0| 20 74 68 69 6e 67 73 2e | 20 20 53 69 6e 63 65 20 | things.| Since |
|000019e0| 74 68 65 73 65 0a 61 72 | 65 20 64 69 6d 65 6e 73 |these.ar|e dimens|
|000019f0| 69 6f 6e 73 20 72 61 74 | 68 65 72 20 74 68 61 6e |ions rat|her than|
|00001a00| 20 62 6f 78 65 73 20 6f | 66 20 74 65 78 74 20 69 | boxes o|f text i|
|00001a10| 74 20 77 69 6c 6c 20 62 | 65 20 6d 6f 73 74 20 63 |t will b|e most c|
|00001a20| 6f 6e 76 65 6e 69 65 6e | 74 20 74 6f 0a 75 73 65 |onvenien|t to.use|
|00001a30| 20 6d 61 63 72 6f 73 20 | 6c 69 6b 65 20 74 68 65 | macros |like the|
|00001a40| 20 6f 6e 65 73 20 67 69 | 76 65 6e 20 6f 6e 20 70 | ones gi|ven on p|
|00001a50| 61 67 65 20 33 37 38 20 | 6f 66 20 74 68 65 20 5c |age 378 |of the \|
|00001a60| 54 65 58 20 62 6f 6f 6b | 2e 20 20 48 6f 77 65 76 |TeX book|. Howev|
|00001a70| 65 72 2c 0a 69 74 20 74 | 75 72 6e 73 20 6f 75 74 |er,.it t|urns out|
|00001a80| 20 74 68 61 74 20 77 65 | 20 6e 65 65 64 20 74 6f | that we| need to|
|00001a90| 20 73 65 74 20 6f 75 72 | 20 6c 69 73 74 73 20 62 | set our| lists b|
|00001aa0| 6f 74 68 20 6c 6f 63 61 | 6c 6c 79 20 74 6f 20 73 |oth loca|lly to s|
|00001ab0| 6f 6d 65 0a 67 72 6f 75 | 70 69 6e 67 20 61 6e 64 |ome.grou|ping and|
|00001ac0| 20 61 6c 73 6f 20 67 6c | 6f 62 61 6c 6c 79 2e 20 | also gl|obally. |
|00001ad0| 20 54 68 65 72 65 66 6f | 72 65 2c 20 77 65 20 77 | Therefo|re, we w|
|00001ae0| 69 6c 6c 20 75 73 65 20 | 61 20 73 74 72 69 70 70 |ill use |a stripp|
|00001af0| 65 64 20 64 6f 77 6e 0a | 76 65 72 73 69 6f 6e 20 |ed down.|version |
|00001b00| 6f 66 20 74 68 6f 73 65 | 20 6c 69 73 74 20 6d 61 |of those| list ma|
|00001b10| 63 72 6f 73 20 74 68 61 | 74 20 63 61 6e 20 68 61 |cros tha|t can ha|
|00001b20| 6e 64 6c 65 20 74 68 65 | 20 2a 5c 67 6c 6f 62 61 |ndle the| *\globa|
|00001b30| 6c 2a 20 66 6c 61 67 2e | 0a 54 6f 20 69 6d 70 6c |l* flag.|.To impl|
|00001b40| 65 6d 65 6e 74 20 74 68 | 69 73 20 66 65 61 74 75 |ement th|is featu|
|00001b50| 72 65 2c 20 77 65 20 68 | 61 76 65 20 74 6f 20 6c |re, we h|ave to l|
|00001b60| 6f 73 65 20 73 6f 6d 65 | 20 6f 74 68 65 72 73 3b |ose some| others;|
|00001b70| 20 74 68 65 20 63 68 69 | 65 66 20 6c 6f 73 73 65 | the chi|ef losse|
|00001b80| 73 0a 61 72 65 20 74 68 | 61 74 20 74 68 65 20 63 |s.are th|at the c|
|00001b90| 6f 6e 74 65 6e 74 73 20 | 6f 66 20 74 68 65 20 6c |ontents |of the l|
|00001ba0| 69 73 74 73 20 77 69 6c | 6c 20 62 65 20 6d 61 63 |ists wil|l be mac|
|00001bb0| 72 6f 2d 65 78 70 61 6e | 64 65 64 20 62 79 20 76 |ro-expan|ded by v|
|00001bc0| 61 72 69 6f 75 73 20 6f | 66 0a 74 68 65 20 6c 69 |arious o|f.the li|
|00001bd0| 73 74 20 6d 61 6e 69 70 | 75 6c 61 74 69 6f 6e 20 |st manip|ulation |
|00001be0| 6d 61 63 72 6f 73 2c 20 | 61 6e 64 20 74 68 61 74 |macros, |and that|
|00001bf0| 20 77 65 20 63 61 6e 27 | 74 20 75 73 65 20 72 65 | we can'|t use re|
|00001c00| 64 65 66 69 6e 69 74 69 | 6f 6e 73 20 6f 66 20 2a |definiti|ons of *|
|00001c10| 5c 5c 2a 0a 74 6f 20 70 | 65 72 66 6f 72 6d 20 73 |\\*.to p|erform s|
|00001c20| 6f 6d 65 20 6f 70 65 72 | 61 74 69 6f 6e 20 6f 6e |ome oper|ation on|
|00001c30| 20 74 68 65 20 77 68 6f | 6c 65 20 6c 69 73 74 2e | the who|le list.|
|00001c40| 0a 0a 54 6f 20 69 6e 69 | 74 69 61 6c 69 7a 65 20 |..To ini|tialize |
|00001c50| 61 20 63 6f 6e 74 72 6f | 6c 20 73 65 71 75 65 6e |a contro|l sequen|
|00001c60| 63 65 20 74 6f 20 74 68 | 65 20 65 6d 70 74 79 20 |ce to th|e empty |
|00001c70| 6c 69 73 74 2c 20 77 65 | 20 64 6f 20 2a 5c 6c 65 |list, we| do *\le|
|00001c80| 74 5c 63 73 6e 61 6d 65 | 5c 6e 69 6c 2a 2e 0a 54 |t\csname|\nil*..T|
|00001c90| 68 65 6e 20 74 6f 20 61 | 64 64 20 61 6e 20 65 6c |hen to a|dd an el|
|00001ca0| 65 6d 65 6e 74 20 74 6f | 20 74 68 65 20 73 74 61 |ement to| the sta|
|00001cb0| 72 74 20 6f 66 20 74 68 | 65 20 6c 69 73 74 20 77 |rt of th|e list w|
|00001cc0| 65 20 64 6f 20 2a 5c 63 | 6f 6e 73 7b 74 6f 6b 65 |e do *\c|ons{toke|
|00001cd0| 6e 73 7d 5c 63 73 6e 61 | 6d 65 2a 2c 0a 61 6e 64 |ns}\csna|me*,.and|
|00001ce0| 20 74 6f 20 72 65 6d 6f | 76 65 20 74 68 61 74 20 | to remo|ve that |
|00001cf0| 65 6c 65 6d 65 6e 74 20 | 77 65 20 64 6f 20 2a 5c |element |we do *\|
|00001d00| 63 64 72 5c 63 73 6e 61 | 6d 65 2a 2e 20 20 42 6f |cdr\csna|me*. Bo|
|00001d10| 74 68 20 2a 5c 63 6f 6e | 73 2a 20 61 6e 64 20 2a |th *\con|s* and *|
|00001d20| 5c 63 64 72 2a 0a 63 61 | 6e 20 62 65 20 70 72 65 |\cdr*.ca|n be pre|
|00001d30| 66 69 78 65 64 20 77 69 | 74 68 20 2a 5c 67 6c 6f |fixed wi|th *\glo|
|00001d40| 62 61 6c 2a 2e 20 20 54 | 68 65 20 66 69 72 73 74 |bal*. T|he first|
|00001d50| 20 65 6c 65 6d 65 6e 74 | 20 6f 6e 20 74 68 65 20 | element| on the |
|00001d60| 6c 69 73 74 20 63 61 6e | 20 62 65 0a 65 78 70 61 |list can| be.expa|
|00001d70| 6e 64 65 64 20 69 6e 74 | 6f 20 74 68 65 20 74 6f |nded int|o the to|
|00001d80| 6b 65 6e 20 73 74 72 65 | 61 6d 20 62 79 20 64 6f |ken stre|am by do|
|00001d90| 69 6e 67 20 2a 5c 63 61 | 72 5c 63 73 6e 61 6d 65 |ing *\ca|r\csname|
|00001da0| 2a 2e 20 20 54 68 65 72 | 65 20 69 73 20 6e 6f 0a |*. Ther|e is no.|
|00001db0| 65 72 72 6f 72 20 63 68 | 65 63 6b 69 6e 67 2c 20 |error ch|ecking, |
|00001dc0| 73 6f 20 67 69 76 69 6e | 67 20 2a 5c 63 61 72 2a |so givin|g *\car*|
|00001dd0| 20 6f 72 20 2a 5c 63 64 | 72 2a 20 74 68 65 20 65 | or *\cd|r* the e|
|00001de0| 6d 70 74 79 20 6c 69 73 | 74 20 77 69 6c 6c 20 63 |mpty lis|t will c|
|00001df0| 61 75 73 65 0a 6d 79 73 | 74 65 72 69 6f 75 73 20 |ause.mys|terious |
|00001e00| 65 72 72 6f 72 73 20 6c | 61 74 65 72 20 6f 6e 2e |errors l|ater on.|
|00001e10| 20 20 42 65 63 61 75 73 | 65 20 6f 66 20 74 68 65 | Becaus|e of the|
|00001e20| 20 6d 61 63 72 6f 20 65 | 78 70 61 6e 73 69 6f 6e | macro e|xpansion|
|00001e30| 20 70 65 72 66 6f 72 6d | 65 64 0a 62 79 20 2a 5c | perform|ed.by *\|
|00001e40| 63 6f 6e 73 2a 20 61 6e | 64 20 2a 5c 63 64 72 2a |cons* an|d *\cdr*|
|00001e50| 2c 20 74 68 65 20 74 6f | 6b 65 6e 20 75 73 65 64 |, the to|ken used|
|00001e60| 20 74 6f 20 73 65 70 61 | 72 61 74 65 20 6c 69 73 | to sepa|rate lis|
|00001e70| 74 20 65 6c 65 6d 65 6e | 74 73 0a 65 78 70 61 6e |t elemen|ts.expan|
|00001e80| 64 73 20 74 6f 20 69 74 | 73 65 6c 66 2c 20 61 6e |ds to it|self, an|
|00001e90| 64 20 75 6e 6c 69 6b 65 | 20 74 68 65 20 5c 54 65 |d unlike| the \Te|
|00001ea0| 58 20 62 6f 6f 6b 20 6d | 61 63 72 6f 73 20 63 61 |X book m|acros ca|
|00001eb0| 6e 6e 6f 74 20 62 65 20 | 72 65 64 65 66 69 6e 65 |nnot be |redefine|
|00001ec0| 64 0a 74 6f 20 64 6f 20 | 61 6e 79 74 68 69 6e 67 |d.to do |anything|
|00001ed0| 20 75 73 65 66 75 6c 2e | 0a 0a 5c 76 62 0a 5c 64 | useful.|..\vb.\d|
|00001ee0| 65 66 5c 63 6f 6e 73 23 | 31 23 32 7b 5c 65 64 65 |ef\cons#|1#2{\ede|
|00001ef0| 66 23 32 7b 5c 78 6d 61 | 72 6b 20 23 31 23 32 7d |f#2{\xma|rk #1#2}|
|00001f00| 7d 20 20 20 20 20 25 20 | 41 64 64 20 73 6f 6d 65 |} % |Add some|
|00001f10| 74 68 69 6e 67 20 74 6f | 20 73 74 61 72 74 20 6f |thing to| start o|
|00001f20| 66 20 6c 69 73 74 2e 0a | 5c 64 65 66 5c 63 61 72 |f list..|\def\car|
|00001f30| 23 31 7b 5c 65 78 70 61 | 6e 64 61 66 74 65 72 5c |#1{\expa|ndafter\|
|00001f40| 64 6f 63 61 72 23 31 5c | 64 6f 63 61 72 7d 20 20 |docar#1\|docar} |
|00001f50| 25 20 54 61 6b 65 20 66 | 69 72 73 74 20 65 6c 65 |% Take f|irst ele|
|00001f60| 6d 65 6e 74 20 6f 66 20 | 6c 69 73 74 0a 5c 64 65 |ment of |list.\de|
|00001f70| 66 5c 64 6f 63 61 72 5c | 78 6d 61 72 6b 23 31 5c |f\docar\|xmark#1\|
|00001f80| 78 6d 61 72 6b 23 32 5c | 64 6f 63 61 72 7b 23 31 |xmark#2\|docar{#1|
|00001f90| 7d 20 20 20 20 25 20 2e | 2e 62 79 20 69 67 6e 6f |} % .|.by igno|
|00001fa0| 72 69 6e 67 20 72 65 73 | 74 20 69 6e 20 65 78 70 |ring res|t in exp|
|00001fb0| 61 6e 73 69 6f 6e 2e 0a | 5c 64 65 66 5c 63 64 72 |ansion..|\def\cdr|
|00001fc0| 23 31 7b 5c 65 78 70 61 | 6e 64 61 66 74 65 72 5c |#1{\expa|ndafter\|
|00001fd0| 64 6f 63 64 72 23 31 5c | 64 6f 63 64 72 23 31 7d |docdr#1\|docdr#1}|
|00001fe0| 25 20 53 69 6d 69 6c 61 | 72 6c 79 2c 20 64 72 6f |% Simila|rly, dro|
|00001ff0| 70 20 66 69 72 73 74 20 | 65 6c 65 6d 65 6e 74 2e |p first |element.|
|00002000| 0a 5c 64 65 66 5c 64 6f | 63 64 72 5c 78 6d 61 72 |.\def\do|cdr\xmar|
|00002010| 6b 23 31 5c 78 6d 61 72 | 6b 23 32 5c 64 6f 63 64 |k#1\xmar|k#2\docd|
|00002020| 72 23 33 7b 5c 64 65 66 | 23 33 7b 5c 78 6d 61 72 |r#3{\def|#3{\xmar|
|00002030| 6b 20 23 32 7d 7d 0a 5c | 64 65 66 5c 78 6d 61 72 |k #2}}.\|def\xmar|
|00002040| 6b 7b 5c 6e 6f 65 78 70 | 61 6e 64 5c 78 6d 61 72 |k{\noexp|and\xmar|
|00002050| 6b 7d 20 20 20 20 20 20 | 20 20 20 20 20 20 20 25 |k} | %|
|00002060| 20 4c 69 73 74 20 73 65 | 70 61 72 61 74 6f 72 20 | List se|parator |
|00002070| 65 78 70 61 6e 64 73 20 | 74 6f 20 73 65 6c 66 2e |expands |to self.|
|00002080| 0a 5c 64 65 66 5c 6e 69 | 6c 7b 5c 78 6d 61 72 6b |.\def\ni|l{\xmark|
|00002090| 7d 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |} | |
|000020a0| 20 20 20 20 20 20 20 20 | 20 25 20 45 6d 70 74 79 | | % Empty|
|000020b0| 20 6c 69 73 74 20 69 73 | 20 6a 75 73 74 20 61 20 | list is| just a |
|000020c0| 73 65 70 61 72 61 74 6f | 72 2e 0a 5c 65 6e 64 76 |separato|r..\endv|
|000020d0| 62 0a 0a 57 65 20 63 61 | 6c 63 75 6c 61 74 65 20 |b..We ca|lculate |
|000020e0| 74 68 65 20 6c 65 76 65 | 6c 20 77 69 64 74 68 73 |the leve|l widths|
|000020f0| 20 62 79 20 63 61 6c 6c | 69 6e 67 20 2a 5c 73 65 | by call|ing *\se|
|00002100| 74 73 69 7a 65 73 2a 20 | 6f 6e 20 74 68 65 20 74 |tsizes* |on the t|
|00002110| 72 65 65 3b 20 69 74 0a | 77 69 6c 6c 20 69 6e 20 |ree; it.|will in |
|00002120| 74 75 72 6e 20 63 61 6c | 6c 20 69 74 73 65 6c 66 |turn cal|l itself|
|00002130| 20 72 65 63 75 72 73 69 | 76 65 6c 79 20 66 6f 72 | recursi|vely for|
|00002140| 20 65 61 63 68 20 6f 66 | 20 69 74 73 20 73 75 62 | each of| its sub|
|00002150| 74 72 65 65 73 2e 20 20 | 54 68 65 0a 74 72 65 65 |trees. |The.tree|
|00002160| 20 62 65 69 6e 67 20 73 | 69 7a 65 64 20 77 69 6c | being s|ized wil|
|00002170| 6c 20 62 65 20 69 6e 20 | 2a 5c 62 6f 78 30 2a 2c |l be in |*\box0*,|
|00002180| 20 77 68 69 63 68 20 69 | 73 20 75 73 65 64 20 61 | which i|s used a|
|00002190| 73 20 73 63 72 61 74 63 | 68 20 69 6e 20 74 68 69 |s scratc|h in thi|
|000021a0| 73 0a 6d 61 63 72 6f 2c | 20 61 6e 64 20 74 68 65 |s.macro,| and the|
|000021b0| 20 6c 69 73 74 20 6f 66 | 20 77 69 64 74 68 73 20 | list of| widths |
|000021c0| 61 6c 72 65 61 64 79 20 | 66 6f 75 6e 64 20 66 6f |already |found fo|
|000021d0| 72 20 74 68 69 73 20 6c | 65 76 65 6c 20 61 6e 64 |r this l|evel and|
|000021e0| 20 62 65 6c 6f 77 0a 77 | 69 6c 6c 20 62 65 20 69 | below.w|ill be i|
|000021f0| 6e 20 2a 5c 74 72 65 65 | 73 69 7a 65 73 2a 20 28 |n *\tree|sizes* (|
|00002200| 69 6e 69 74 69 61 6c 6c | 79 20 2a 5c 6e 69 6c 2a |initiall|y *\nil*|
|00002210| 29 2e 20 20 57 68 65 6e | 20 74 68 65 20 6d 61 63 |). When| the mac|
|00002220| 72 6f 20 65 78 69 74 73 | 2c 0a 2a 5c 74 72 65 65 |ro exits|,.*\tree|
|00002230| 73 69 7a 65 73 2a 20 77 | 69 6c 6c 20 62 65 20 75 |sizes* w|ill be u|
|00002240| 70 64 61 74 65 64 20 77 | 69 74 68 20 74 68 65 20 |pdated w|ith the |
|00002250| 77 69 64 74 68 73 20 66 | 6f 75 6e 64 20 69 6e 20 |widths f|ound in |
|00002260| 74 68 65 20 76 61 72 69 | 6f 75 73 0a 6c 65 76 65 |the vari|ous.leve|
|00002270| 6c 73 20 6f 66 20 74 68 | 65 20 67 69 76 65 6e 20 |ls of th|e given |
|00002280| 74 72 65 65 20 6f 72 20 | 73 75 62 74 72 65 65 2e |tree or |subtree.|
|00002290| 20 20 41 20 6e 65 77 20 | 2a 5c 64 69 6d 65 6e 2a | A new |*\dimen*|
|000022a0| 2c 20 2a 5c 74 72 65 65 | 77 69 64 74 68 2a 2c 20 |, *\tree|width*, |
|000022b0| 69 73 0a 75 73 65 64 20 | 77 69 74 68 69 6e 20 74 |is.used |within t|
|000022c0| 68 65 20 6d 61 63 72 6f | 20 74 6f 20 72 65 6d 65 |he macro| to reme|
|000022d0| 6d 62 65 72 20 74 68 65 | 20 70 72 65 76 69 6f 75 |mber the| previou|
|000022e0| 73 20 6d 61 78 69 6d 75 | 6d 20 77 69 64 74 68 20 |s maximu|m width |
|000022f0| 61 74 20 74 68 65 0a 6c | 65 76 65 6c 20 6f 66 20 |at the.l|evel of |
|00002300| 74 68 65 20 74 72 65 65 | 27 73 20 72 6f 6f 74 2e |the tree|'s root.|
|00002310| 0a 0a 5c 76 62 0a 5c 64 | 65 66 5c 73 65 74 74 72 |..\vb.\d|ef\settr|
|00002320| 65 65 73 69 7a 65 73 7b | 5c 73 65 74 62 6f 78 30 |eesizes{|\setbox0|
|00002330| 3d 5c 63 6f 70 79 5c 74 | 72 65 65 62 6f 78 20 5c |=\copy\t|reebox \|
|00002340| 67 6c 6f 62 61 6c 5c 6c | 65 74 5c 74 72 65 65 73 |global\l|et\trees|
|00002350| 69 7a 65 73 5c 6e 69 6c | 20 5c 73 65 74 73 69 7a |izes\nil| \setsiz|
|00002360| 65 73 7d 0a 5c 6e 65 77 | 64 69 6d 65 6e 5c 74 72 |es}.\new|dimen\tr|
|00002370| 65 65 77 69 64 74 68 20 | 20 20 20 20 20 20 20 20 |eewidth | |
|00002380| 20 20 20 20 20 20 20 20 | 20 20 20 20 25 20 57 69 | | % Wi|
|00002390| 64 74 68 20 6f 66 20 74 | 68 69 73 20 70 61 72 74 |dth of t|his part|
|000023a0| 20 6f 66 20 74 68 65 20 | 74 72 65 65 2e 0a 5c 64 | of the |tree..\d|
|000023b0| 65 66 5c 73 65 74 73 69 | 7a 65 73 7b 5c 73 65 74 |ef\setsi|zes{\set|
|000023c0| 62 6f 78 30 3d 5c 68 62 | 6f 78 5c 62 67 72 6f 75 |box0=\hb|ox\bgrou|
|000023d0| 70 20 20 20 20 20 25 20 | 47 65 74 20 61 20 68 6f |p % |Get a ho|
|000023e0| 72 69 7a 20 6c 69 73 74 | 20 61 73 20 61 20 77 6f |riz list| as a wo|
|000023f0| 72 6b 73 70 61 63 65 2e | 0a 20 20 5c 75 6e 68 62 |rkspace.|. \unhb|
|00002400| 6f 78 30 5c 75 6e 73 6b | 69 70 20 20 20 20 20 20 |ox0\unsk|ip |
|00002410| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00002420| 20 25 20 54 61 6b 65 20 | 74 72 65 65 2c 20 75 6e | % Take |tree, un|
|00002430| 70 61 63 6b 20 69 74 20 | 69 6e 74 6f 20 68 6f 72 |pack it |into hor|
|00002440| 69 7a 20 6c 69 73 74 2e | 0a 20 20 5c 69 6e 69 74 |iz list.|. \init|
|00002450| 74 72 65 65 77 69 64 74 | 68 20 20 20 20 20 20 20 |treewidt|h |
|00002460| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00002470| 20 25 20 47 65 74 20 6f | 6c 64 20 77 69 64 74 68 | % Get o|ld width|
|00002480| 20 61 74 20 74 68 69 73 | 20 6c 65 76 65 6c 2e 0a | at this| level..|
|00002490| 20 20 5c 73 69 7a 65 73 | 75 62 74 72 65 65 73 20 | \sizes|ubtrees |
|000024a0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000024b0| 20 20 20 20 20 20 20 20 | 25 20 52 65 63 75 72 73 | |% Recurs|
|000024c0| 65 20 74 68 72 6f 75 67 | 68 20 61 6c 6c 20 73 75 |e throug|h all su|
|000024d0| 62 74 72 65 65 73 2e 0a | 20 20 5c 73 69 7a 65 6c |btrees..| \sizel|
|000024e0| 65 76 65 6c 20 20 20 20 | 20 20 20 20 20 20 20 20 |evel | |
|000024f0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00002500| 25 20 4e 6f 77 20 73 65 | 74 20 77 69 64 74 68 20 |% Now se|t width |
|00002510| 66 72 6f 6d 20 72 65 6d | 61 69 6e 69 6e 67 20 5c |from rem|aining \|
|00002520| 76 62 6f 78 2e 0a 20 20 | 5c 65 67 72 6f 75 70 7d |vbox.. |\egroup}|
|00002530| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00002540| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 25 20 | | % |
|00002550| 41 6c 6c 20 64 6f 6e 65 | 2c 20 66 69 6e 69 73 68 |All done|, finish|
|00002560| 20 6f 75 72 20 5c 68 62 | 6f 78 2e 0a 5c 65 6e 64 | our \hb|ox..\end|
|00002570| 76 62 0a 0a 54 68 65 20 | 66 69 72 73 74 20 74 68 |vb..The |first th|
|00002580| 69 6e 67 20 2a 5c 73 65 | 74 73 69 7a 65 73 2a 20 |ing *\se|tsizes* |
|00002590| 64 6f 65 73 20 69 73 20 | 74 6f 20 66 69 6e 64 20 |does is |to find |
|000025a0| 6f 75 74 20 77 68 61 74 | 20 74 68 65 20 70 72 65 |out what| the pre|
|000025b0| 76 69 6f 75 73 0a 6d 61 | 78 69 6d 75 6d 20 61 74 |vious.ma|ximum at|
|000025c0| 20 74 68 69 73 20 6c 65 | 76 65 6c 20 77 61 73 2c | this le|vel was,|
|000025d0| 20 61 6e 64 20 73 74 6f | 72 65 20 69 74 20 69 6e | and sto|re it in|
|000025e0| 20 2a 5c 74 72 65 65 77 | 69 64 74 68 2a 2e 20 20 | *\treew|idth*. |
|000025f0| 49 66 0a 2a 5c 74 72 65 | 65 73 69 7a 65 73 2a 20 |If.*\tre|esizes* |
|00002600| 69 73 20 2a 5c 6e 69 6c | 2a 2c 20 77 65 20 68 61 |is *\nil|*, we ha|
|00002610| 76 65 6e 27 74 20 73 65 | 65 6e 20 61 6e 79 74 68 |ven't se|en anyth|
|00002620| 69 6e 67 20 74 68 69 73 | 20 64 65 65 70 20 69 6e |ing this| deep in|
|00002630| 20 74 68 65 20 74 72 65 | 65 0a 62 65 66 6f 72 65 | the tre|e.before|
|00002640| 2c 20 73 6f 20 74 68 65 | 20 70 72 65 76 69 6f 75 |, so the| previou|
|00002650| 73 20 73 69 7a 65 20 69 | 73 20 7a 65 72 6f 2e 20 |s size i|s zero. |
|00002660| 20 4f 74 68 65 72 77 69 | 73 65 2c 20 69 74 20 69 | Otherwi|se, it i|
|00002670| 73 20 2a 5c 63 61 72 5c | 74 72 65 65 73 69 7a 65 |s *\car\|treesize|
|00002680| 73 2a 2c 0a 61 6e 64 20 | 77 65 20 61 6c 73 6f 20 |s*,.and |we also |
|00002690| 64 6f 20 2a 5c 63 64 72 | 5c 74 72 65 65 73 69 7a |do *\cdr|\treesiz|
|000026a0| 65 73 2a 20 74 6f 20 70 | 72 65 70 61 72 65 20 66 |es* to p|repare f|
|000026b0| 6f 72 20 6c 61 74 65 72 | 20 72 65 63 75 72 73 69 |or later| recursi|
|000026c0| 76 65 20 63 61 6c 6c 73 | 0a 74 6f 20 2a 5c 73 65 |ve calls|.to *\se|
|000026d0| 74 73 69 7a 65 73 2a 2e | 0a 0a 5c 76 62 0a 5c 64 |tsizes*.|..\vb.\d|
|000026e0| 65 66 5c 69 6e 69 74 74 | 72 65 65 77 69 64 74 68 |ef\initt|reewidth|
|000026f0| 7b 5c 69 66 78 5c 74 72 | 65 65 73 69 7a 65 73 5c |{\ifx\tr|eesizes\|
|00002700| 6e 69 6c 20 20 20 25 20 | 49 66 20 74 68 69 73 20 |nil % |If this |
|00002710| 69 73 20 74 68 65 20 66 | 69 72 73 74 20 61 74 20 |is the f|irst at |
|00002720| 74 68 69 73 20 6c 65 76 | 65 6c 0a 20 20 20 20 5c |this lev|el. \|
|00002730| 74 72 65 65 77 69 64 74 | 68 3d 30 70 74 20 20 20 |treewidt|h=0pt |
|00002740| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00002750| 20 20 20 25 20 2e 2e 74 | 68 65 6e 20 77 65 20 68 | % ..t|hen we h|
|00002760| 61 76 65 20 6e 6f 20 70 | 72 65 76 69 6f 75 73 20 |ave no p|revious |
|00002770| 6d 61 78 20 77 69 64 74 | 68 2e 0a 20 20 5c 65 6c |max widt|h.. \el|
|00002780| 73 65 20 5c 74 72 65 65 | 77 69 64 74 68 3d 5c 63 |se \tree|width=\c|
|00002790| 61 72 5c 74 72 65 65 73 | 69 7a 65 73 20 20 20 20 |ar\trees|izes |
|000027a0| 20 20 20 25 20 4f 74 68 | 65 72 77 69 73 65 20 74 | % Oth|erwise t|
|000027b0| 61 6b 65 20 6f 6c 64 20 | 6d 61 78 20 6c 65 76 65 |ake old |max leve|
|000027c0| 6c 20 77 69 64 74 68 0a | 20 20 20 20 5c 67 6c 6f |l width.| \glo|
|000027d0| 62 61 6c 5c 63 64 72 5c | 74 72 65 65 73 69 7a 65 |bal\cdr\|treesize|
|000027e0| 73 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |s | |
|000027f0| 25 20 2e 2e 61 6e 64 20 | 61 64 76 61 6e 63 65 20 |% ..and |advance |
|00002800| 6c 65 76 65 6c 20 77 69 | 64 74 68 20 73 74 6f 72 |level wi|dth stor|
|00002810| 61 67 65 0a 20 20 20 20 | 5c 66 69 7d 20 20 20 20 |age. |\fi} |
|00002820| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00002830| 20 20 20 20 20 20 20 20 | 20 20 20 20 25 20 2e 2e | | % ..|
|00002840| 69 6e 20 70 72 65 70 61 | 72 61 74 69 6f 6e 20 66 |in prepa|ration f|
|00002850| 6f 72 20 6e 65 78 74 20 | 6c 65 76 65 6c 2e 0a 5c |or next |level..\|
|00002860| 65 6e 64 76 62 0a 0a 41 | 74 20 74 68 69 73 20 70 |endvb..A|t this p|
|00002870| 6f 69 6e 74 2c 20 77 65 | 20 68 61 76 65 20 61 20 |oint, we| have a |
|00002880| 68 6f 72 69 7a 6f 6e 74 | 61 6c 20 6c 69 73 74 20 |horizont|al list |
|00002890| 28 74 68 65 20 2a 5c 68 | 62 6f 78 2a 20 69 6e 20 |(the *\h|box* in |
|000028a0| 2a 5c 73 65 74 73 69 7a | 65 73 2a 29 0a 63 6f 6e |*\setsiz|es*).con|
|000028b0| 74 61 69 6e 69 6e 67 20 | 74 68 65 20 2a 5c 76 62 |taining |the *\vb|
|000028c0| 6f 78 2a 20 66 6f 72 20 | 74 68 65 20 74 65 78 74 |ox* for |the text|
|000028d0| 20 61 74 20 74 68 65 20 | 72 6f 6f 74 20 6f 66 20 | at the |root of |
|000028e0| 74 68 69 73 20 73 75 62 | 74 72 65 65 2c 0a 66 6f |this sub|tree,.fo|
|000028f0| 6c 6c 6f 77 65 64 20 62 | 79 20 74 68 65 20 2a 5c |llowed b|y the *\|
|00002900| 68 62 6f 78 2a 65 73 20 | 66 6f 72 20 61 6c 6c 20 |hbox*es |for all |
|00002910| 6f 66 20 69 74 73 20 73 | 75 62 2d 73 75 62 74 72 |of its s|ub-subtr|
|00002920| 65 65 73 2e 20 20 57 65 | 20 6c 6f 6f 70 20 70 75 |ees. We| loop pu|
|00002930| 6c 6c 69 6e 67 20 62 6f | 78 65 73 0a 66 72 6f 6d |lling bo|xes.from|
|00002940| 20 74 68 65 20 65 6e 64 | 20 6f 66 20 74 68 65 20 | the end| of the |
|00002950| 6c 69 73 74 20 77 69 74 | 68 20 2a 5c 6c 61 73 74 |list wit|h *\last|
|00002960| 62 6f 78 2a 20 75 6e 74 | 69 6c 20 77 65 20 66 69 |box* unt|il we fi|
|00002970| 6e 64 20 74 68 65 20 74 | 65 78 74 20 2a 5c 76 62 |nd the t|ext *\vb|
|00002980| 6f 78 2a 2c 0a 63 61 6c | 6c 69 6e 67 20 2a 5c 73 |ox*,.cal|ling *\s|
|00002990| 65 74 73 69 7a 65 73 2a | 20 72 65 63 75 72 73 69 |etsizes*| recursi|
|000029a0| 76 65 6c 79 20 66 6f 72 | 20 65 61 63 68 20 2a 5c |vely for| each *\|
|000029b0| 68 62 6f 78 2a 20 77 65 | 20 63 6f 6d 65 20 61 63 |hbox* we| come ac|
|000029c0| 72 6f 73 73 2e 0a 0a 5c | 76 62 0a 5c 64 65 66 5c |ross...\|vb.\def\|
|000029d0| 73 69 7a 65 73 75 62 74 | 72 65 65 73 7b 5c 6c 6f |sizesubt|rees{\lo|
|000029e0| 6f 70 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |op | |
|000029f0| 20 20 20 25 20 46 6f 72 | 20 65 61 63 68 20 62 6f | % For| each bo|
|00002a00| 78 20 69 6e 20 68 6f 72 | 69 7a 20 6c 69 73 74 20 |x in hor|iz list |
|00002a10| 28 73 75 62 74 72 65 65 | 29 0a 20 20 5c 73 65 74 |(subtree|). \set|
|00002a20| 62 6f 78 30 3d 5c 6c 61 | 73 74 62 6f 78 20 5c 75 |box0=\la|stbox \u|
|00002a30| 6e 73 6b 69 70 20 20 20 | 20 20 20 20 20 20 20 20 |nskip | |
|00002a40| 20 20 25 20 2e 2e 70 75 | 6c 6c 20 69 74 20 6f 66 | % ..pu|ll it of|
|00002a50| 66 20 6c 69 73 74 20 61 | 6e 64 20 66 6c 75 73 68 |f list a|nd flush|
|00002a60| 20 67 6c 75 65 2e 0a 20 | 20 5c 69 66 68 62 6f 78 | glue.. | \ifhbox|
|00002a70| 30 20 5c 73 65 74 73 69 | 7a 65 73 20 20 20 20 20 |0 \setsi|zes |
|00002a80| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 25 | | %|
|00002a90| 20 49 66 20 68 62 6f 78 | 2c 20 69 74 27 73 20 61 | If hbox|, it's a|
|00002aa0| 20 73 75 62 74 72 65 65 | 20 2d 20 72 65 63 75 72 | subtree| - recur|
|00002ab0| 73 65 0a 20 20 5c 72 65 | 70 65 61 74 7d 20 20 20 |se. \re|peat} |
|00002ac0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00002ad0| 20 20 20 20 20 20 20 20 | 20 20 20 25 20 2e 2e 61 | | % ..a|
|00002ae0| 6e 64 20 6c 6f 6f 70 3b | 20 65 6e 64 20 6c 6f 6f |nd loop;| end loo|
|00002af0| 70 20 6f 6e 20 74 72 65 | 65 20 74 65 78 74 2e 0a |p on tre|e text..|
|00002b00| 5c 65 6e 64 76 62 0a 0a | 4e 6f 77 20 61 6c 6c 20 |\endvb..|Now all |
|00002b10| 74 68 61 74 20 72 65 6d | 61 69 6e 73 20 74 6f 20 |that rem|ains to |
|00002b20| 64 6f 20 69 6e 20 74 68 | 69 73 20 63 61 6c 6c 20 |do in th|is call |
|00002b30| 74 6f 20 2a 5c 73 65 74 | 73 69 7a 65 73 2a 20 69 |to *\set|sizes* i|
|00002b40| 73 20 74 6f 20 75 70 64 | 61 74 65 0a 2a 5c 74 72 |s to upd|ate.*\tr|
|00002b50| 65 65 77 69 64 74 68 2a | 20 69 66 20 74 68 65 20 |eewidth*| if the |
|00002b60| 74 65 78 74 20 62 6f 78 | 2c 20 77 68 69 63 68 20 |text box|, which |
|00002b70| 63 61 6e 20 62 65 20 66 | 6f 75 6e 64 20 69 6e 20 |can be f|ound in |
|00002b80| 2a 5c 62 6f 78 30 2a 2c | 20 69 73 20 77 69 64 65 |*\box0*,| is wide|
|00002b90| 72 0a 74 68 61 6e 20 74 | 68 65 20 70 72 65 76 69 |r.than t|he previ|
|00002ba0| 6f 75 73 20 6d 61 78 69 | 6d 75 6d 2e 20 20 54 68 |ous maxi|mum. Th|
|00002bb0| 65 6e 20 77 65 20 61 64 | 64 20 74 68 65 20 28 70 |en we ad|d the (p|
|00002bc0| 6f 73 73 69 62 6c 79 20 | 75 70 64 61 74 65 64 29 |ossibly |updated)|
|00002bd0| 20 76 61 6c 75 65 0a 6f | 66 20 2a 5c 74 72 65 65 | value.o|f *\tree|
|00002be0| 77 69 64 74 68 2a 20 61 | 73 20 61 20 74 65 78 74 |width* a|s a text|
|00002bf0| 20 73 74 72 69 6e 67 20 | 62 61 63 6b 20 6f 6e 74 | string |back ont|
|00002c00| 6f 20 74 68 65 20 68 65 | 61 64 20 6f 66 20 2a 5c |o the he|ad of *\|
|00002c10| 74 72 65 65 73 69 7a 65 | 73 2a 2e 0a 0a 5c 76 62 |treesize|s*...\vb|
|00002c20| 0a 5c 64 65 66 5c 73 69 | 7a 65 6c 65 76 65 6c 7b |.\def\si|zelevel{|
|00002c30| 5c 69 66 64 69 6d 5c 74 | 72 65 65 77 69 64 74 68 |\ifdim\t|reewidth|
|00002c40| 3c 5c 77 64 30 20 20 20 | 20 25 20 49 66 20 67 72 |<\wd0 | % If gr|
|00002c50| 65 61 74 65 72 20 74 68 | 61 6e 20 70 72 65 76 69 |eater th|an previ|
|00002c60| 6f 75 73 20 6d 61 78 69 | 6d 75 6d 0a 20 20 20 5c |ous maxi|mum. \|
|00002c70| 74 72 65 65 77 69 64 74 | 68 3d 5c 77 64 30 20 5c |treewidt|h=\wd0 \|
|00002c80| 66 69 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |fi | |
|00002c90| 20 20 20 20 25 20 54 68 | 65 6e 20 73 65 74 20 6d | % Th|en set m|
|00002ca0| 61 78 20 74 6f 20 6e 65 | 77 20 68 69 67 68 0a 20 |ax to ne|w high. |
|00002cb0| 5c 67 6c 6f 62 61 6c 5c | 63 6f 6e 73 7b 5c 74 68 |\global\|cons{\th|
|00002cc0| 65 5c 74 72 65 65 77 69 | 64 74 68 7d 5c 74 72 65 |e\treewi|dth}\tre|
|00002cd0| 65 73 69 7a 65 73 7d 25 | 20 49 6e 20 65 69 74 68 |esizes}%| In eith|
|00002ce0| 65 72 20 63 61 73 65 2c | 20 70 75 74 20 62 61 63 |er case,| put bac|
|00002cf0| 6b 20 6f 6e 20 6c 69 73 | 74 0a 5c 65 6e 64 76 62 |k on lis|t.\endvb|
|00002d00| 0a 0c 0a 5c 62 65 67 69 | 6e 73 65 63 74 69 6f 6e |...\begi|nsection|
|00002d10| 20 50 61 73 73 20 33 3a | 20 54 79 70 65 73 65 74 | Pass 3:| Typeset|
|00002d20| 74 69 6e 67 20 74 68 65 | 20 74 72 65 65 0a 0a 57 |ting the| tree..W|
|00002d30| 65 20 61 72 65 20 6e 6f | 77 20 72 65 61 64 79 20 |e are no|w ready |
|00002d40| 74 6f 20 62 65 67 69 6e | 20 61 63 74 75 61 6c 20 |to begin| actual |
|00002d50| 63 6f 6e 73 74 72 75 63 | 74 69 6f 6e 20 6f 66 20 |construc|tion of |
|00002d60| 74 68 65 20 74 72 65 65 | 2e 20 20 54 68 69 73 20 |the tree|. This |
|00002d70| 69 73 0a 64 6f 6e 65 20 | 62 79 20 63 61 6c 6c 69 |is.done |by calli|
|00002d80| 6e 67 20 2a 5c 6d 61 6b | 65 74 72 65 65 2a 2c 20 |ng *\mak|etree*, |
|00002d90| 77 68 69 63 68 20 6c 69 | 6b 65 20 2a 5c 73 65 74 |which li|ke *\set|
|00002da0| 73 69 7a 65 73 2a 20 63 | 61 6c 6c 73 20 69 74 73 |sizes* c|alls its|
|00002db0| 65 6c 66 0a 72 65 63 75 | 72 73 69 76 65 6c 79 20 |elf.recu|rsively |
|00002dc0| 66 6f 72 20 61 6c 6c 20 | 73 75 62 74 72 65 65 73 |for all |subtrees|
|00002dd0| 2e 20 20 49 74 20 61 64 | 64 73 20 61 6e 20 2a 5c |. It ad|ds an *\|
|00002de0| 68 62 6f 78 2a 20 63 6f | 6e 74 61 69 6e 69 6e 67 |hbox* co|ntaining|
|00002df0| 20 74 68 65 20 67 69 76 | 65 6e 0a 73 75 62 74 72 | the giv|en.subtr|
|00002e00| 65 65 20 28 77 68 69 63 | 68 20 69 74 20 66 69 6e |ee (whic|h it fin|
|00002e10| 64 73 20 69 6e 20 2a 5c | 74 72 65 65 62 6f 78 2a |ds in *\|treebox*|
|00002e20| 29 20 74 6f 20 74 68 65 | 20 63 75 72 72 65 6e 74 |) to the| current|
|00002e30| 20 68 6f 72 69 7a 6f 6e | 74 61 6c 20 6c 69 73 74 | horizon|tal list|
|00002e40| 3b 0a 74 68 75 73 20 74 | 68 65 20 6f 75 74 65 72 |;.thus t|he outer|
|00002e50| 20 63 61 6c 6c 20 74 6f | 20 2a 5c 6d 61 6b 65 74 | call to| *\maket|
|00002e60| 72 65 65 2a 20 73 65 6e | 64 73 20 74 68 65 20 77 |ree* sen|ds the w|
|00002e70| 68 6f 6c 65 20 74 72 65 | 65 20 69 6e 74 6f 20 5c |hole tre|e into \|
|00002e80| 54 65 58 27 73 0a 6f 75 | 74 70 75 74 20 73 74 72 |TeX's.ou|tput str|
|00002e90| 65 61 6d 2e 20 20 0a 0a | 5c 76 62 0a 5c 6e 65 77 |eam. ..|\vb.\new|
|00002ea0| 64 69 6d 65 6e 5c 74 72 | 65 65 68 65 69 67 68 74 |dimen\tr|eeheight|
|00002eb0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00002ec0| 20 20 20 20 25 20 48 65 | 69 67 68 74 20 6f 66 20 | % He|ight of |
|00002ed0| 74 68 69 73 20 70 61 72 | 74 20 6f 66 20 74 68 65 |this par|t of the|
|00002ee0| 20 74 72 65 65 2e 0a 5c | 6e 65 77 69 66 5c 69 66 | tree..\|newif\if|
|00002ef0| 6c 65 61 66 20 20 20 20 | 20 20 20 20 20 20 20 20 |leaf | |
|00002f00| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 25 | | %|
|00002f10| 20 54 72 65 65 20 68 61 | 73 20 6e 6f 20 73 75 62 | Tree ha|s no sub|
|00002f20| 74 72 65 65 73 20 28 69 | 73 20 61 20 6c 65 61 66 |trees (i|s a leaf|
|00002f30| 29 2e 0a 5c 6e 65 77 69 | 66 5c 69 66 62 6f 74 73 |)..\newi|f\ifbots|
|00002f40| 75 62 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |ub | |
|00002f50| 20 20 20 20 20 20 20 20 | 20 20 20 25 20 42 6f 74 | | % Bot|
|00002f60| 74 6f 6d 20 73 75 62 74 | 72 65 65 20 6f 66 20 70 |tom subt|ree of p|
|00002f70| 61 72 65 6e 74 2e 0a 5c | 6e 65 77 69 66 5c 69 66 |arent..\|newif\if|
|00002f80| 74 6f 70 73 75 62 20 20 | 20 20 20 20 20 20 20 20 |topsub | |
|00002f90| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 25 | | %|
|00002fa0| 20 54 6f 70 20 73 75 62 | 74 72 65 65 20 6f 66 20 | Top sub|tree of |
|00002fb0| 70 61 72 65 6e 74 2e 0a | 5c 64 65 66 5c 74 79 70 |parent..|\def\typ|
|00002fc0| 65 73 65 74 74 72 65 65 | 7b 5c 6d 65 64 73 6b 69 |esettree|{\medski|
|00002fd0| 70 20 5c 6d 61 6b 65 74 | 72 65 65 20 5c 6d 65 64 |p \maket|ree \med|
|00002fe0| 73 6b 69 70 7d 20 20 20 | 25 20 4d 61 6b 65 20 77 |skip} |% Make w|
|00002ff0| 68 6f 6c 65 20 74 72 65 | 65 20 77 69 74 68 20 73 |hole tre|e with s|
|00003000| 70 61 63 69 6e 67 2e 0a | 5c 64 65 66 5c 6d 61 6b |pacing..|\def\mak|
|00003010| 65 74 72 65 65 7b 5c 68 | 62 6f 78 7b 5c 74 72 65 |etree{\h|box{\tre|
|00003020| 65 77 69 64 74 68 3d 5c | 63 61 72 5c 74 72 65 65 |ewidth=\|car\tree|
|00003030| 73 69 7a 65 73 20 20 20 | 25 20 47 65 74 20 77 69 |sizes |% Get wi|
|00003040| 64 74 68 20 61 74 20 74 | 68 69 73 20 6c 65 76 65 |dth at t|his leve|
|00003050| 6c 2e 0a 20 20 5c 63 64 | 72 5c 74 72 65 65 73 69 |l.. \cd|r\treesi|
|00003060| 7a 65 73 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |zes | |
|00003070| 20 20 20 20 20 20 20 20 | 20 20 20 25 20 53 65 74 | | % Set|
|00003080| 20 75 70 20 77 69 64 74 | 68 20 6c 69 73 74 20 66 | up widt|h list f|
|00003090| 6f 72 20 72 65 63 75 72 | 73 69 6f 6e 2e 0a 20 20 |or recur|sion.. |
|000030a0| 5c 6d 61 6b 65 73 75 62 | 74 72 65 65 62 6f 78 5c |\makesub|treebox\|
|000030b0| 75 6e 73 6b 69 70 20 20 | 20 20 20 20 20 20 20 20 |unskip | |
|000030c0| 20 20 20 20 20 20 25 20 | 53 65 74 20 5c 74 72 65 | % |Set \tre|
|000030d0| 65 62 6f 78 20 74 6f 20 | 74 65 78 74 2c 20 6d 61 |ebox to |text, ma|
|000030e0| 6b 65 20 73 75 62 74 72 | 65 65 73 2e 0a 20 20 5c |ke subtr|ees.. \|
|000030f0| 69 66 6c 65 61 66 20 5c | 6d 61 6b 65 6c 65 61 66 |ifleaf \|makeleaf|
|00003100| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00003110| 20 20 20 20 20 25 20 4e | 6f 20 73 75 62 74 72 65 | % N|o subtre|
|00003120| 65 73 2c 20 61 64 64 20 | 67 6c 75 65 2e 0a 20 20 |es, add |glue.. |
|00003130| 5c 65 6c 73 65 20 5c 6d | 61 6b 65 70 61 72 65 6e |\else \m|akeparen|
|00003140| 74 20 5c 66 69 7d 7d 20 | 20 20 20 20 20 20 20 20 |t \fi}} | |
|00003150| 20 20 20 20 20 20 25 20 | 48 61 76 65 20 73 75 62 | % |Have sub|
|00003160| 74 72 65 65 73 2c 20 73 | 74 69 63 6b 20 74 68 65 |trees, s|tick the|
|00003170| 6d 20 61 74 20 72 69 67 | 68 74 2e 0a 5c 65 6e 64 |m at rig|ht..\end|
|00003180| 76 62 0a 0a 41 66 74 65 | 72 20 2a 5c 6d 61 6b 65 |vb..Afte|r *\make|
|00003190| 74 72 65 65 2a 20 73 65 | 74 73 20 2a 5c 74 72 65 |tree* se|ts *\tre|
|000031a0| 65 77 69 64 74 68 2a 20 | 66 72 6f 6d 20 2a 5c 74 |ewidth* |from *\t|
|000031b0| 72 65 65 73 69 7a 65 73 | 2a 2c 20 69 74 20 63 61 |reesizes|*, it ca|
|000031c0| 6c 6c 73 0a 2a 5c 6d 61 | 6b 65 73 75 62 74 72 65 |lls.*\ma|kesubtre|
|000031d0| 65 62 6f 78 2a 2e 20 20 | 54 68 69 73 20 6f 70 65 |ebox*. |This ope|
|000031e0| 6e 73 20 75 70 20 74 68 | 65 20 68 6f 72 69 7a 6f |ns up th|e horizo|
|000031f0| 6e 74 61 6c 20 6c 69 73 | 74 20 64 65 73 63 72 69 |ntal lis|t descri|
|00003200| 62 69 6e 67 20 74 68 69 | 73 0a 6c 65 76 65 6c 20 |bing thi|s.level |
|00003210| 6f 66 20 74 68 65 20 74 | 72 65 65 2c 20 61 6e 64 |of the t|ree, and|
|00003220| 20 63 68 65 63 6b 73 20 | 77 68 65 74 68 65 72 20 | checks |whether |
|00003230| 69 74 20 68 61 73 20 73 | 75 62 74 72 65 65 73 2e |it has s|ubtrees.|
|00003240| 20 20 49 66 20 6e 6f 74 | 2c 0a 2a 5c 69 66 6c 65 | If not|,.*\ifle|
|00003250| 61 66 2a 20 69 73 20 73 | 65 74 20 74 6f 20 74 72 |af* is s|et to tr|
|00003260| 75 65 3b 20 6f 74 68 65 | 72 77 69 73 65 20 69 74 |ue; othe|rwise it|
|00003270| 20 69 73 20 73 65 74 20 | 74 6f 20 66 61 6c 73 65 | is set |to false|
|00003280| 2c 20 61 6e 64 20 2a 5c | 62 6f 78 30 2a 0a 69 73 |, and *\|box0*.is|
|00003290| 20 73 65 74 20 74 6f 20 | 63 6f 6e 74 61 69 6e 20 | set to |contain |
|000032a0| 61 20 2a 5c 76 62 6f 78 | 2a 20 6f 66 20 74 68 65 |a *\vbox|* of the|
|000032b0| 6d 20 77 69 74 68 20 74 | 68 65 69 72 20 63 6f 6e |m with t|heir con|
|000032c0| 6e 65 63 74 69 6e 67 20 | 72 75 6c 65 73 2c 0a 65 |necting |rules,.e|
|000032d0| 78 63 65 70 74 20 66 6f | 72 20 74 68 65 20 68 6f |xcept fo|r the ho|
|000032e0| 72 69 7a 6f 6e 74 61 6c | 20 72 75 6c 65 20 6c 65 |rizontal| rule le|
|000032f0| 61 64 69 6e 67 20 66 72 | 6f 6d 20 74 68 65 20 74 |ading fr|om the t|
|00003300| 72 65 65 20 74 65 78 74 | 20 74 6f 20 74 68 65 0a |ree text| to the.|
|00003310| 73 75 62 74 72 65 65 73 | 2e 20 20 49 6e 20 61 6e |subtrees|. In an|
|00003320| 79 20 63 61 73 65 20 2a | 5c 74 72 65 65 62 6f 78 |y case *|\treebox|
|00003330| 2a 20 69 73 20 73 65 74 | 20 74 6f 20 74 68 65 20 |* is set| to the |
|00003340| 2a 5c 76 62 6f 78 2a 20 | 63 6f 6e 74 61 69 6e 69 |*\vbox* |containi|
|00003350| 6e 67 20 74 68 65 0a 74 | 72 65 65 20 74 65 78 74 |ng the.t|ree text|
|00003360| 2e 0a 0a 5c 76 62 0a 0a | 7b 5c 63 61 74 63 6f 64 |...\vb..|{\catcod|
|00003370| 65 60 40 3d 31 31 20 20 | 20 20 20 20 20 20 20 20 |e`@=11 | |
|00003380| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00003390| 25 20 42 65 20 61 62 6c | 65 20 74 6f 20 75 73 65 |% Be abl|e to use|
|000033a0| 20 5c 76 6f 69 64 62 40 | 78 2e 0a 5c 67 64 65 66 | \voidb@|x..\gdef|
|000033b0| 5c 6d 61 6b 65 73 75 62 | 74 72 65 65 62 6f 78 7b |\makesub|treebox{|
|000033c0| 5c 75 6e 68 62 6f 78 5c | 74 72 65 65 62 6f 78 20 |\unhbox\|treebox |
|000033d0| 20 20 20 25 20 4f 70 65 | 6e 20 75 70 20 74 72 65 | % Ope|n up tre|
|000033e0| 65 20 6f 72 20 73 75 62 | 74 72 65 65 2e 0a 20 20 |e or sub|tree.. |
|000033f0| 5c 75 6e 73 6b 69 70 5c | 67 6c 6f 62 61 6c 5c 73 |\unskip\|global\s|
|00003400| 65 74 62 6f 78 5c 74 72 | 65 65 62 6f 78 5c 6c 61 |etbox\tr|eebox\la|
|00003410| 73 74 62 6f 78 20 25 20 | 50 69 63 6b 20 75 70 20 |stbox % |Pick up |
|00003420| 76 65 72 79 20 6c 61 73 | 74 20 62 6f 78 2e 0a 20 |very las|t box.. |
|00003430| 20 5c 69 66 76 62 6f 78 | 5c 74 72 65 65 62 6f 78 | \ifvbox|\treebox|
|00003440| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00003450| 20 20 20 20 20 20 20 25 | 20 49 66 20 77 65 27 72 | %| If we'r|
|00003460| 65 20 61 6c 72 65 61 64 | 79 20 61 74 20 74 68 65 |e alread|y at the|
|00003470| 20 5c 76 62 6f 78 0a 20 | 20 20 20 5c 67 6c 6f 62 | \vbox. | \glob|
|00003480| 61 6c 5c 6c 65 61 66 74 | 72 75 65 20 5c 6c 65 74 |al\leaft|rue \let|
|00003490| 5c 6e 65 78 74 5c 72 65 | 6c 61 78 20 20 20 20 25 |\next\re|lax %|
|000034a0| 20 2e 2e 74 68 65 6e 20 | 74 68 69 73 20 69 73 20 | ..then |this is |
|000034b0| 61 20 6c 65 61 66 2e 0a | 20 20 5c 65 6c 73 65 20 |a leaf..| \else |
|000034c0| 5c 62 6f 74 73 75 62 74 | 72 75 65 20 20 20 20 20 |\botsubt|rue |
|000034d0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000034e0| 25 20 4f 74 68 65 72 77 | 69 73 65 2c 20 77 65 20 |% Otherw|ise, we |
|000034f0| 68 61 76 65 20 73 75 62 | 74 72 65 65 73 2e 0a 20 |have sub|trees.. |
|00003500| 20 20 20 5c 73 65 74 62 | 6f 78 30 5c 62 6f 78 5c | \setb|ox0\box\|
|00003510| 76 6f 69 64 62 40 78 20 | 20 20 20 20 20 20 20 20 |voidb@x | |
|00003520| 20 20 20 20 20 20 20 25 | 20 49 6e 69 74 20 73 74 | %| Init st|
|00003530| 61 63 6b 20 6f 66 20 70 | 72 6f 63 65 73 73 65 64 |ack of p|rocessed|
|00003540| 20 73 75 62 73 0a 20 20 | 20 20 5c 62 6f 74 73 75 | subs. | \botsu|
|00003550| 62 74 72 75 65 20 5c 6c | 65 74 5c 6e 65 78 74 5c |btrue \l|et\next\|
|00003560| 6d 61 6b 65 73 75 62 74 | 72 65 65 20 20 20 25 20 |makesubt|ree % |
|00003570| 2e 2e 61 6e 64 20 63 61 | 6c 6c 20 5c 6d 61 6b 65 |..and ca|ll \make|
|00003580| 74 72 65 65 20 6f 6e 20 | 74 68 65 6d 2e 0a 20 20 |tree on |them.. |
|00003590| 5c 66 69 20 5c 6e 65 78 | 74 7d 7d 20 20 20 20 20 |\fi \nex|t}} |
|000035a0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000035b0| 20 20 20 20 20 20 25 20 | 46 69 6e 69 73 68 20 75 | % |Finish u|
|000035c0| 70 20 66 6f 72 20 77 68 | 69 63 68 65 76 65 72 20 |p for wh|ichever |
|000035d0| 69 74 20 77 61 73 2e 0a | 5c 65 6e 64 76 62 0a 0a |it was..|\endvb..|
|000035e0| 49 66 20 74 68 69 73 20 | 74 72 65 65 20 6f 72 20 |If this |tree or |
|000035f0| 73 75 62 74 72 65 65 20 | 69 74 73 65 6c 66 20 68 |subtree |itself h|
|00003600| 61 73 20 73 75 62 74 72 | 65 65 73 2c 20 77 65 20 |as subtr|ees, we |
|00003610| 6e 65 65 64 20 74 6f 20 | 70 75 74 20 74 68 65 6d |need to |put them|
|00003620| 20 61 6e 64 0a 74 68 65 | 69 72 20 63 6f 6e 6e 65 | and.the|ir conne|
|00003630| 63 74 69 6f 6e 73 20 69 | 6e 20 2a 5c 62 6f 78 30 |ctions i|n *\box0|
|00003640| 2a 20 66 6f 72 20 2a 5c | 6d 61 6b 65 73 75 62 74 |* for *\|makesubt|
|00003650| 72 65 65 62 6f 78 2a 2e | 20 20 57 65 20 63 6f 6d |reebox*.| We com|
|00003660| 65 20 68 65 72 65 20 77 | 69 74 68 0a 74 68 65 20 |e here w|ith.the |
|00003670| 62 6f 74 74 6f 6d 20 73 | 75 62 74 72 65 65 20 69 |bottom s|ubtree i|
|00003680| 6e 20 2a 5c 74 72 65 65 | 62 6f 78 2a 2c 20 74 68 |n *\tree|box*, th|
|00003690| 65 20 72 65 6d 61 69 6e | 69 6e 67 20 6c 69 73 74 |e remain|ing list|
|000036a0| 20 6f 66 20 73 75 62 74 | 72 65 65 73 20 69 6e 0a | of subt|rees in.|
|000036b0| 74 68 65 20 63 75 72 72 | 65 6e 74 20 68 6f 72 69 |the curr|ent hori|
|000036c0| 7a 6f 6e 74 61 6c 20 6c | 69 73 74 2c 20 61 6e 64 |zontal l|ist, and|
|000036d0| 20 74 68 65 20 61 6c 72 | 65 61 64 79 20 70 72 6f | the alr|eady pro|
|000036e0| 63 65 73 73 65 64 20 73 | 75 62 74 72 65 65 73 0a |cessed s|ubtrees.|
|000036f0| 73 74 61 63 6b 65 64 20 | 69 6e 20 2a 5c 62 6f 78 |stacked |in *\box|
|00003700| 30 2a 2e 20 20 54 68 65 | 20 2a 5c 69 66 62 6f 74 |0*. The| *\ifbot|
|00003710| 73 75 62 2a 20 74 65 73 | 74 20 77 69 6c 6c 20 62 |sub* tes|t will b|
|00003720| 65 20 74 72 75 65 20 66 | 6f 72 20 74 68 65 20 66 |e true f|or the f|
|00003730| 69 72 73 74 0a 63 61 6c | 6c 2c 20 74 68 61 74 20 |irst.cal|l, that |
|00003740| 69 73 2c 20 74 68 65 20 | 62 6f 74 74 6f 6d 20 73 |is, the |bottom s|
|00003750| 75 62 74 72 65 65 2e 20 | 20 48 65 72 65 20 77 65 |ubtree. | Here we|
|00003760| 20 70 72 6f 63 65 73 73 | 20 74 68 65 20 73 75 62 | process| the sub|
|00003770| 74 72 65 65 20 69 6e 0a | 2a 5c 74 72 65 65 62 6f |tree in.|*\treebo|
|00003780| 78 2a 2e 20 20 49 66 20 | 74 68 69 73 20 69 73 20 |x*. If |this is |
|00003790| 74 68 65 20 74 6f 70 20 | 73 75 62 74 72 65 65 2c |the top |subtree,|
|000037a0| 20 77 65 20 72 65 74 75 | 72 6e 3b 20 6f 74 68 65 | we retu|rn; othe|
|000037b0| 72 77 69 73 65 20 77 65 | 20 74 61 69 6c 0a 72 65 |rwise we| tail.re|
|000037c0| 63 75 72 73 65 20 74 6f | 20 70 72 6f 63 65 73 73 |curse to| process|
|000037d0| 20 74 68 65 20 72 65 6d | 61 69 6e 69 6e 67 20 73 | the rem|aining s|
|000037e0| 75 62 74 72 65 65 73 2e | 20 20 57 65 20 75 73 65 |ubtrees.| We use|
|000037f0| 20 2a 5c 62 6f 78 31 2a | 20 61 73 0a 61 6e 6f 74 | *\box1*| as.anot|
|00003800| 68 65 72 20 73 63 72 61 | 74 63 68 20 76 61 72 69 |her scra|tch vari|
|00003810| 61 62 6c 65 3b 20 74 68 | 69 73 20 69 73 20 73 61 |able; th|is is sa|
|00003820| 66 65 20 62 65 63 61 75 | 73 65 20 74 68 65 20 2a |fe becau|se the *|
|00003830| 5c 68 62 6f 78 2a 20 69 | 6e 20 2a 5c 6d 61 6b 65 |\hbox* i|n *\make|
|00003840| 74 72 65 65 2a 0a 70 75 | 74 73 20 75 73 20 69 6e |tree*.pu|ts us in|
|00003850| 73 69 64 65 20 61 20 67 | 72 6f 75 70 2c 20 61 6e |side a g|roup, an|
|00003860| 64 20 61 6c 73 6f 20 62 | 65 63 61 75 73 65 20 77 |d also b|ecause w|
|00003870| 65 20 61 72 65 20 6e 6f | 74 20 63 68 61 6e 67 69 |e are no|t changi|
|00003880| 6e 67 20 74 68 65 20 6f | 75 74 70 75 74 20 6c 69 |ng the o|utput li|
|00003890| 73 74 2e 0a 0a 5c 70 65 | 6e 61 6c 74 79 2d 32 30 |st...\pe|nalty-20|
|000038a0| 30 09 09 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |0..%%%%%|%%%%%%%%|
|000038b0| 25 25 25 25 25 25 25 09 | 61 64 64 65 64 20 66 6f |%%%%%%%.|added fo|
|000038c0| 72 20 54 55 47 62 6f 61 | 74 0a 0a 5c 76 62 0a 0a |r TUGboa|t..\vb..|
|000038d0| 5c 64 65 66 5c 6d 61 6b | 65 73 75 62 74 72 65 65 |\def\mak|esubtree|
|000038e0| 7b 5c 73 65 74 62 6f 78 | 31 5c 6d 61 6b 65 74 72 |{\setbox|1\maketr|
|000038f0| 65 65 20 20 20 20 20 20 | 25 20 43 61 6c 6c 20 5c |ee |% Call \|
|00003900| 6d 61 6b 65 74 72 65 65 | 20 6f 6e 20 74 68 69 73 |maketree| on this|
|00003910| 20 73 75 62 74 72 65 65 | 2e 0a 20 20 5c 75 6e 73 | subtree|.. \uns|
|00003920| 6b 69 70 5c 67 6c 6f 62 | 61 6c 5c 73 65 74 62 6f |kip\glob|al\setbo|
|00003930| 78 5c 74 72 65 65 62 6f | 78 5c 6c 61 73 74 62 6f |x\treebo|x\lastbo|
|00003940| 78 20 25 20 50 69 63 6b | 20 75 70 20 62 6f 78 20 |x % Pick| up box |
|00003950| 62 65 66 6f 72 65 20 69 | 74 2e 0a 20 20 5c 74 72 |before i|t.. \tr|
|00003960| 65 65 68 65 69 67 68 74 | 3d 5c 68 74 31 20 20 20 |eeheight|=\ht1 |
|00003970| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00003980| 20 20 20 25 20 47 65 74 | 20 68 65 69 67 68 74 20 | % Get| height |
|00003990| 6f 66 20 73 75 62 74 72 | 65 65 20 77 65 20 6d 61 |of subtr|ee we ma|
|000039a0| 64 65 0a 20 20 5c 61 64 | 76 61 6e 63 65 5c 74 72 |de. \ad|vance\tr|
|000039b0| 65 65 68 65 69 67 68 74 | 20 32 65 78 20 20 20 20 |eeheight| 2ex |
|000039c0| 20 20 20 20 20 20 20 20 | 20 20 20 25 20 41 64 64 | | % Add|
|000039d0| 20 73 6f 6d 65 20 72 6f | 6f 6d 20 61 72 6f 75 6e | some ro|om aroun|
|000039e0| 64 20 74 68 65 20 65 64 | 67 65 73 0a 20 20 5c 69 |d the ed|ges. \i|
|000039f0| 66 68 62 6f 78 5c 74 72 | 65 65 62 6f 78 20 5c 74 |fhbox\tr|eebox \t|
|00003a00| 6f 70 73 75 62 66 61 6c | 73 65 20 20 20 20 20 20 |opsubfal|se |
|00003a10| 20 20 20 20 25 20 49 66 | 20 70 69 63 6b 65 64 20 | % If| picked |
|00003a20| 75 70 20 62 6f 78 20 69 | 73 20 61 20 5c 76 62 6f |up box i|s a \vbo|
|00003a30| 78 2c 0a 20 20 20 20 5c | 65 6c 73 65 20 5c 74 6f |x,. \|else \to|
|00003a40| 70 73 75 62 74 72 75 65 | 20 5c 66 69 20 20 20 20 |psubtrue| \fi |
|00003a50| 20 20 20 20 20 20 20 20 | 20 20 20 25 20 2e 2e 74 | | % ..t|
|00003a60| 68 69 73 20 69 73 20 74 | 68 65 20 74 6f 70 2c 20 |his is t|he top, |
|00003a70| 6f 74 68 65 72 77 69 73 | 65 20 6e 6f 74 2e 0a 20 |otherwis|e not.. |
|00003a80| 20 5c 61 64 64 73 75 62 | 74 72 65 65 62 6f 78 20 | \addsub|treebox |
|00003a90| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00003aa0| 20 20 20 20 20 20 20 25 | 20 53 74 61 63 6b 20 73 | %| Stack s|
|00003ab0| 75 62 74 72 65 65 20 77 | 69 74 68 20 74 68 65 20 |ubtree w|ith the |
|00003ac0| 72 65 73 74 2e 0a 20 20 | 5c 69 66 74 6f 70 73 75 |rest.. |\iftopsu|
|00003ad0| 62 20 5c 67 6c 6f 62 61 | 6c 5c 6c 65 61 66 66 61 |b \globa|l\leaffa|
|00003ae0| 6c 73 65 20 20 20 20 20 | 20 20 20 20 20 20 25 20 |lse | % |
|00003af0| 49 66 20 74 6f 70 2c 20 | 72 65 6d 65 6d 62 65 72 |If top, |remember|
|00003b00| 20 6e 6f 74 20 61 20 6c | 65 61 66 0a 20 20 20 20 | not a l|eaf. |
|00003b10| 5c 6c 65 74 5c 6e 65 78 | 74 5c 72 65 6c 61 78 20 |\let\nex|t\relax |
|00003b20| 5c 65 6c 73 65 20 20 20 | 20 20 20 20 20 20 20 20 |\else | |
|00003b30| 20 20 20 20 25 20 2e 2e | 28 61 66 74 65 72 20 72 | % ..|(after r|
|00003b40| 65 63 75 72 73 69 6f 6e | 29 2c 20 73 65 74 20 72 |ecursion|), set r|
|00003b50| 65 74 75 72 6e 2e 0a 20 | 20 20 20 5c 62 6f 74 73 |eturn.. | \bots|
|00003b60| 75 62 66 61 6c 73 65 20 | 5c 6c 65 74 5c 6e 65 78 |ubfalse |\let\nex|
|00003b70| 74 5c 6d 61 6b 65 73 75 | 62 74 72 65 65 20 20 25 |t\makesu|btree %|
|00003b80| 20 4f 74 68 65 72 77 69 | 73 65 2c 20 77 65 20 68 | Otherwi|se, we h|
|00003b90| 61 76 65 20 6d 6f 72 65 | 20 73 75 62 74 72 65 65 |ave more| subtree|
|00003ba0| 73 2e 0a 20 20 5c 66 69 | 20 5c 6e 65 78 74 7d 20 |s.. \fi| \next} |
|00003bb0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00003bc0| 20 20 20 20 20 20 20 20 | 20 20 20 25 20 44 6f 20 | | % Do |
|00003bd0| 74 61 69 6c 20 72 65 63 | 75 72 73 69 6f 6e 20 6f |tail rec|ursion o|
|00003be0| 72 20 72 65 74 75 72 6e | 2e 0a 5c 65 6e 64 76 62 |r return|..\endvb|
|00003bf0| 0a 0a 45 61 63 68 20 73 | 75 62 74 72 65 65 20 69 |..Each s|ubtree i|
|00003c00| 6e 20 74 68 65 20 6c 69 | 73 74 20 69 73 20 70 72 |n the li|st is pr|
|00003c10| 6f 63 65 73 73 65 64 20 | 61 6e 64 20 73 74 61 63 |ocessed |and stac|
|00003c20| 6b 65 64 20 69 6e 20 2a | 5c 62 6f 78 30 2a 3b 20 |ked in *|\box0*; |
|00003c30| 74 68 69 73 20 69 73 0a | 64 6f 6e 65 20 62 79 20 |this is.|done by |
|00003c40| 2a 5c 61 64 64 73 75 62 | 74 72 65 65 62 6f 78 2a |*\addsub|treebox*|
|00003c50| 2c 20 77 68 69 63 68 20 | 63 61 6c 6c 73 20 2a 5c |, which |calls *\|
|00003c60| 73 75 62 74 72 65 65 62 | 6f 78 2a 20 74 6f 20 61 |subtreeb|ox* to a|
|00003c70| 64 64 20 63 6f 6e 6e 65 | 63 74 69 6e 67 0a 72 75 |dd conne|cting.ru|
|00003c80| 6c 65 73 20 74 6f 20 74 | 68 65 20 73 75 62 74 72 |les to t|he subtr|
|00003c90| 65 65 20 69 6e 20 2a 5c | 62 6f 78 31 2a 2c 20 61 |ee in *\|box1*, a|
|00003ca0| 6e 64 20 61 70 70 65 6e | 64 73 20 74 6f 20 74 68 |nd appen|ds to th|
|00003cb0| 61 74 20 74 68 65 20 6f | 6c 64 20 63 6f 6e 74 65 |at the o|ld conte|
|00003cc0| 6e 74 73 0a 6f 66 20 2a | 5c 62 6f 78 30 2a 2e 20 |nts.of *|\box0*. |
|00003cd0| 20 54 68 65 20 76 65 72 | 74 69 63 61 6c 20 63 6f | The ver|tical co|
|00003ce0| 6e 6e 65 63 74 69 6e 67 | 20 72 75 6c 65 73 20 69 |nnecting| rules i|
|00003cf0| 6e 20 74 68 65 20 74 72 | 65 65 20 61 72 65 20 6d |n the tr|ee are m|
|00003d00| 61 64 65 20 77 69 74 68 | 0a 74 61 6c 6c 20 6e 61 |ade with|.tall na|
|00003d10| 72 72 6f 77 20 2a 5c 68 | 72 75 6c 65 2a 73 20 72 |rrow *\h|rule*s r|
|00003d20| 61 74 68 65 72 20 74 68 | 61 6e 20 61 20 6d 6f 72 |ather th|an a mor|
|00003d30| 65 20 73 69 6d 70 6c 65 | 20 63 61 6c 6c 73 20 74 |e simple| calls t|
|00003d40| 6f 20 2a 5c 76 72 75 6c | 65 2a 2c 0a 62 65 63 61 |o *\vrul|e*,.beca|
|00003d50| 75 73 65 20 74 68 65 79 | 20 61 72 65 20 6d 61 64 |use they| are mad|
|00003d60| 65 20 69 6e 73 69 64 65 | 20 61 20 2a 5c 76 62 6f |e inside| a *\vbo|
|00003d70| 78 2a 2e 0a 0a 5c 76 62 | 0a 5c 64 65 66 5c 61 64 |x*...\vb|.\def\ad|
|00003d80| 64 73 75 62 74 72 65 65 | 62 6f 78 7b 5c 73 65 74 |dsubtree|box{\set|
|00003d90| 62 6f 78 30 3d 5c 76 62 | 6f 78 7b 5c 73 75 62 74 |box0=\vb|ox{\subt|
|00003da0| 72 65 65 62 6f 78 5c 75 | 6e 76 62 6f 78 30 7d 7d |reebox\u|nvbox0}}|
|00003db0| 0a 5c 64 65 66 5c 73 75 | 62 74 72 65 65 62 6f 78 |.\def\su|btreebox|
|00003dc0| 7b 5c 68 62 6f 78 5c 62 | 67 72 6f 75 70 20 20 20 |{\hbox\b|group |
|00003dd0| 20 20 20 20 20 20 20 20 | 20 25 20 53 74 61 72 74 | | % Start|
|00003de0| 20 5c 68 62 6f 78 20 6f | 66 20 74 72 65 65 20 61 | \hbox o|f tree a|
|00003df0| 6e 64 20 6c 69 6e 65 73 | 0a 20 20 5c 76 62 6f 78 |nd lines|. \vbox|
|00003e00| 20 74 6f 20 5c 74 72 65 | 65 68 65 69 67 68 74 5c | to \tre|eheight\|
|00003e10| 62 67 72 6f 75 70 20 20 | 20 20 20 20 20 20 20 20 |bgroup | |
|00003e20| 20 25 20 53 74 61 72 74 | 20 5c 76 62 6f 78 20 66 | % Start| \vbox f|
|00003e30| 6f 72 20 76 65 72 74 69 | 63 61 6c 20 72 75 6c 65 |or verti|cal rule|
|00003e40| 73 2e 0a 20 20 20 20 5c | 69 66 62 6f 74 73 75 62 |s.. \|ifbotsub|
|00003e50| 20 5c 69 66 74 6f 70 73 | 75 62 20 5c 76 66 69 6c | \iftops|ub \vfil|
|00003e60| 20 20 20 20 20 20 20 20 | 20 20 20 25 20 49 66 20 | | % If |
|00003e70| 62 6f 74 68 20 62 6f 74 | 74 6f 6d 20 61 6e 64 20 |both bot|tom and |
|00003e80| 74 6f 70 20 73 75 62 74 | 72 65 65 0a 20 20 20 20 |top subt|ree. |
|00003e90| 20 20 20 20 5c 68 72 75 | 6c 65 20 77 69 64 74 68 | \hru|le width|
|00003ea0| 20 30 2e 34 70 74 20 20 | 20 20 20 20 20 20 20 20 | 0.4pt | |
|00003eb0| 20 20 20 20 25 20 2e 2e | 76 65 72 74 69 63 61 6c | % ..|vertical|
|00003ec0| 20 72 75 6c 65 20 69 73 | 20 6a 75 73 74 20 61 20 | rule is| just a |
|00003ed0| 64 6f 74 2e 0a 20 20 20 | 20 20 20 5c 65 6c 73 65 |dot.. | \else|
|00003ee0| 20 5c 74 72 65 65 68 61 | 6c 66 72 75 6c 65 20 5c | \treeha|lfrule \|
|00003ef0| 66 69 20 5c 76 66 69 6c | 20 20 20 20 20 25 20 42 |fi \vfil| % B|
|00003f00| 6f 74 74 6f 6d 20 67 65 | 74 73 20 68 61 6c 66 2d |ottom ge|ts half-|
|00003f10| 68 65 69 67 68 74 20 72 | 75 6c 65 2e 0a 20 20 20 |height r|ule.. |
|00003f20| 20 5c 65 6c 73 65 20 5c | 69 66 74 6f 70 73 75 62 | \else \|iftopsub|
|00003f30| 20 5c 76 66 69 6c 20 5c | 74 72 65 65 68 61 6c 66 | \vfil \|treehalf|
|00003f40| 72 75 6c 65 20 25 20 54 | 6f 70 20 67 65 74 73 20 |rule % T|op gets |
|00003f50| 68 61 6c 66 2d 68 65 69 | 67 68 74 20 74 68 65 20 |half-hei|ght the |
|00003f60| 6f 74 68 65 72 20 77 61 | 79 2e 0a 20 20 20 20 20 |other wa|y.. |
|00003f70| 20 5c 65 6c 73 65 20 5c | 68 72 75 6c 65 20 77 69 | \else \|hrule wi|
|00003f80| 64 74 68 20 30 2e 34 70 | 74 20 68 65 69 67 68 74 |dth 0.4p|t height|
|00003f90| 20 5c 74 72 65 65 68 65 | 69 67 68 74 20 5c 66 69 | \treehe|ight \fi|
|00003fa0| 5c 66 69 20 25 20 4d 69 | 64 64 6c 65 2c 20 66 75 |\fi % Mi|ddle, fu|
|00003fb0| 6c 6c 20 68 65 69 67 68 | 74 2e 0a 20 20 20 20 5c |ll heigh|t.. \|
|00003fc0| 65 67 72 6f 75 70 20 20 | 20 20 20 20 20 20 20 20 |egroup | |
|00003fd0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00003fe0| 20 20 20 25 20 46 69 6e | 69 73 68 20 76 65 72 74 | % Fin|ish vert|
|00003ff0| 69 63 61 6c 20 72 75 6c | 65 20 5c 76 62 6f 78 2e |ical rul|e \vbox.|
|00004000| 0a 20 20 5c 74 72 65 65 | 63 74 72 62 6f 78 7b 5c |. \tree|ctrbox{\|
|00004010| 68 72 75 6c 65 20 77 69 | 64 74 68 20 31 65 6d 7d |hrule wi|dth 1em}|
|00004020| 5c 68 73 6b 69 70 20 30 | 2e 32 65 6d 5c 74 72 65 |\hskip 0|.2em\tre|
|00004030| 65 63 74 72 62 6f 78 7b | 5c 62 6f 78 31 7d 5c 65 |ectrbox{|\box1}\e|
|00004040| 67 72 6f 75 70 7d 0a 5c | 65 6e 64 76 62 0a 0a 54 |group}.\|endvb..T|
|00004050| 68 65 20 6c 61 73 74 20 | 6c 69 6e 65 20 6f 66 20 |he last |line of |
|00004060| 74 68 65 20 64 65 66 69 | 6e 69 74 69 6f 6e 20 6f |the defi|nition o|
|00004070| 66 20 2a 5c 73 75 62 74 | 72 65 65 62 6f 78 2a 20 |f *\subt|reebox* |
|00004080| 63 61 6c 6c 73 20 2a 5c | 74 72 65 65 63 74 72 62 |calls *\|treectrb|
|00004090| 6f 78 2a 0a 74 77 69 63 | 65 3a 20 6f 6e 63 65 20 |ox*.twic|e: once |
|000040a0| 66 6f 72 20 74 68 65 20 | 68 6f 72 69 7a 6f 6e 74 |for the |horizont|
|000040b0| 61 6c 20 63 6f 6e 6e 65 | 63 74 69 6e 67 20 72 75 |al conne|cting ru|
|000040c0| 6c 65 2c 20 61 6e 64 20 | 6f 6e 63 65 20 66 6f 72 |le, and |once for|
|000040d0| 20 74 68 65 0a 73 75 62 | 74 72 65 65 20 62 6f 78 | the.sub|tree box|
|000040e0| 20 69 74 73 65 6c 66 2e | 20 20 54 68 69 73 20 6d | itself.| This m|
|000040f0| 61 63 72 6f 20 63 65 6e | 74 65 72 73 20 69 74 73 |acro cen|ters its|
|00004100| 20 61 72 67 75 6d 65 6e | 74 20 69 6e 20 61 20 2a | argumen|t in a *|
|00004110| 5c 76 62 6f 78 2a 20 74 | 68 65 0a 68 65 69 67 68 |\vbox* t|he.heigh|
|00004120| 74 20 6f 66 20 74 68 69 | 73 20 73 75 62 74 72 65 |t of thi|s subtre|
|00004130| 65 20 61 6e 64 20 73 75 | 72 72 6f 75 6e 64 69 6e |e and su|rroundin|
|00004140| 67 20 73 70 61 63 65 2e | 20 20 57 65 20 61 6c 73 |g space.| We als|
|00004150| 6f 20 64 65 66 69 6e 65 | 20 68 65 72 65 0a 2a 5c |o define| here.*\|
|00004160| 74 72 65 65 68 61 6c 66 | 72 75 6c 65 2a 2c 20 74 |treehalf|rule*, t|
|00004170| 68 65 20 6d 61 63 72 6f | 20 63 61 6c 6c 65 64 20 |he macro| called |
|00004180| 74 6f 20 6d 61 6b 65 20 | 61 6e 20 2a 5c 68 72 75 |to make |an *\hru|
|00004190| 6c 65 2a 20 68 61 6c 66 | 20 74 68 65 20 68 65 69 |le* half| the hei|
|000041a0| 67 68 74 0a 6f 66 20 74 | 68 65 20 73 75 62 74 72 |ght.of t|he subtr|
|000041b0| 65 65 20 28 77 69 74 68 | 20 68 61 6c 66 20 74 68 |ee (with| half th|
|000041c0| 65 20 68 65 69 67 68 74 | 20 6f 66 20 74 68 65 20 |e height| of the |
|000041d0| 68 6f 72 69 7a 6f 6e 74 | 61 6c 20 63 6f 6e 6e 65 |horizont|al conne|
|000041e0| 63 74 69 6f 6e 0a 61 64 | 64 65 64 20 74 6f 20 6d |ction.ad|ded to m|
|000041f0| 61 6b 65 20 74 68 65 20 | 63 6f 72 6e 65 72 73 20 |ake the |corners |
|00004200| 63 6f 6d 65 20 6f 75 74 | 20 73 71 75 61 72 65 29 |come out| square)|
|00004210| 2e 0a 0a 5c 76 62 0a 5c | 64 65 66 5c 74 72 65 65 |...\vb.\|def\tree|
|00004220| 63 74 72 62 6f 78 23 31 | 7b 5c 76 62 6f 78 20 74 |ctrbox#1|{\vbox t|
|00004230| 6f 20 5c 74 72 65 65 68 | 65 69 67 68 74 7b 5c 76 |o \treeh|eight{\v|
|00004240| 66 69 6c 20 23 31 5c 76 | 66 69 6c 7d 7d 0a 5c 64 |fil #1\v|fil}}.\d|
|00004250| 65 66 5c 74 72 65 65 68 | 61 6c 66 72 75 6c 65 7b |ef\treeh|alfrule{|
|00004260| 5c 64 69 6d 65 6e 30 3d | 5c 74 72 65 65 68 65 69 |\dimen0=|\treehei|
|00004270| 67 68 74 20 20 20 25 20 | 47 65 74 20 74 6f 74 61 |ght % |Get tota|
|00004280| 6c 20 68 65 69 67 68 74 | 2e 0a 20 20 5c 64 69 76 |l height|.. \div|
|00004290| 69 64 65 5c 64 69 6d 65 | 6e 30 20 32 5c 61 64 76 |ide\dime|n0 2\adv|
|000042a0| 61 6e 63 65 5c 64 69 6d | 65 6e 30 20 30 2e 32 70 |ance\dim|en0 0.2p|
|000042b0| 74 20 25 20 44 69 76 69 | 64 65 20 62 79 20 74 77 |t % Divi|de by tw|
|000042c0| 6f 2c 20 61 64 64 20 68 | 61 6c 66 20 68 6f 72 69 |o, add h|alf hori|
|000042d0| 7a 20 68 65 69 67 68 74 | 2e 0a 20 20 5c 68 72 75 |z height|.. \hru|
|000042e0| 6c 65 20 77 69 64 74 68 | 20 30 2e 34 70 74 20 68 |le width| 0.4pt h|
|000042f0| 65 69 67 68 74 20 5c 64 | 69 6d 65 6e 30 7d 20 20 |eight \d|imen0} |
|00004300| 20 20 25 20 4d 61 6b 65 | 20 61 20 76 65 72 74 69 | % Make| a verti|
|00004310| 63 61 6c 20 72 75 6c 65 | 20 74 68 61 74 20 68 69 |cal rule| that hi|
|00004320| 67 68 2e 0a 5c 65 6e 64 | 76 62 0a 0a 54 68 61 74 |gh..\end|vb..That|
|00004330| 20 63 6f 6d 70 6c 65 74 | 65 73 20 2a 5c 6d 61 6b | complet|es *\mak|
|00004340| 65 73 75 62 74 72 65 65 | 2a 2e 20 20 49 66 20 74 |esubtree|*. If t|
|00004350| 68 69 73 20 73 75 62 74 | 72 65 65 20 68 61 73 20 |his subt|ree has |
|00004360| 6e 6f 20 73 75 62 2d 73 | 75 62 74 72 65 65 73 0a |no sub-s|ubtrees.|
|00004370| 75 6e 64 65 72 20 69 74 | 2c 20 2a 5c 6d 61 6b 65 |under it|, *\make|
|00004380| 74 72 65 65 2a 20 77 69 | 6c 6c 20 6e 6f 77 20 72 |tree* wi|ll now r|
|00004390| 75 6e 20 2a 5c 6d 61 6b | 65 6c 65 61 66 2a 3b 20 |un *\mak|eleaf*; |
|000043a0| 74 68 69 73 20 6d 65 72 | 65 6c 79 20 61 64 64 73 |this mer|ely adds|
|000043b0| 20 74 68 65 0a 74 72 65 | 65 20 74 65 78 74 20 74 | the.tre|e text t|
|000043c0| 6f 20 74 68 65 20 2a 5c | 68 62 6f 78 2a 20 6f 70 |o the *\|hbox* op|
|000043d0| 65 6e 65 64 20 69 6e 20 | 2a 5c 6d 61 6b 65 74 72 |ened in |*\maketr|
|000043e0| 65 65 2a 2e 20 20 4f 74 | 68 65 72 77 69 73 65 20 |ee*. Ot|herwise |
|000043f0| 77 65 20 63 61 6c 6c 0a | 2a 5c 6d 61 6b 65 70 61 |we call.|*\makepa|
|00004400| 72 65 6e 74 2a 20 74 6f | 20 61 74 74 61 63 68 20 |rent* to| attach |
|00004410| 74 68 65 20 73 75 62 2d | 73 75 62 74 72 65 65 73 |the sub-|subtrees|
|00004420| 20 61 6e 64 20 63 6f 6e | 6e 65 63 74 69 6e 67 20 | and con|necting |
|00004430| 72 75 6c 65 73 20 74 6f | 20 74 68 65 0a 74 65 78 |rules to| the.tex|
|00004440| 74 20 61 74 20 74 68 65 | 20 72 6f 6f 74 20 6f 66 |t at the| root of|
|00004450| 20 74 68 65 20 73 75 62 | 74 72 65 65 2e 0a 0a 5c | the sub|tree...\|
|00004460| 76 62 0a 5c 64 65 66 5c | 6d 61 6b 65 6c 65 61 66 |vb.\def\|makeleaf|
|00004470| 7b 5c 62 6f 78 5c 74 72 | 65 65 62 6f 78 7d 20 20 |{\box\tr|eebox} |
|00004480| 20 20 20 20 20 20 20 20 | 20 20 20 25 20 41 64 64 | | % Add|
|00004490| 20 6c 65 61 66 20 62 6f | 78 20 74 6f 20 68 6f 72 | leaf bo|x to hor|
|000044a0| 69 7a 20 6c 69 73 74 2e | 0a 5c 64 65 66 5c 6d 61 |iz list.|.\def\ma|
|000044b0| 6b 65 70 61 72 65 6e 74 | 7b 5c 69 66 64 69 6d 5c |keparent|{\ifdim\|
|000044c0| 68 74 5c 74 72 65 65 62 | 6f 78 3e 5c 68 74 30 20 |ht\treeb|ox>\ht0 |
|000044d0| 20 25 20 49 66 20 74 65 | 78 74 20 69 73 20 68 69 | % If te|xt is hi|
|000044e0| 67 68 65 72 20 74 68 61 | 6e 20 73 75 62 74 72 65 |gher tha|n subtre|
|000044f0| 65 73 0a 20 20 20 20 5c | 74 72 65 65 68 65 69 67 |es. \|treeheig|
|00004500| 68 74 3d 5c 68 74 5c 74 | 72 65 65 62 6f 78 20 20 |ht=\ht\t|reebox |
|00004510| 20 20 20 20 20 20 20 20 | 20 20 20 25 20 2e 2e 75 | | % ..u|
|00004520| 73 65 20 74 68 61 74 20 | 68 65 69 67 68 74 2e 0a |se that |height..|
|00004530| 20 20 5c 65 6c 73 65 20 | 5c 74 72 65 65 68 65 69 | \else |\treehei|
|00004540| 67 68 74 3d 5c 68 74 30 | 20 5c 66 69 20 20 20 20 |ght=\ht0| \fi |
|00004550| 20 20 20 20 20 20 20 20 | 25 20 4f 74 68 65 72 77 | |% Otherw|
|00004560| 69 73 65 20 75 73 65 20 | 68 65 69 67 68 74 20 6f |ise use |height o|
|00004570| 66 20 73 75 62 74 72 65 | 65 73 2e 0a 20 20 5c 61 |f subtre|es.. \a|
|00004580| 64 76 61 6e 63 65 5c 74 | 72 65 65 77 69 64 74 68 |dvance\t|reewidth|
|00004590| 2d 5c 77 64 5c 74 72 65 | 65 62 6f 78 20 20 20 20 |-\wd\tre|ebox |
|000045a0| 20 20 20 20 25 20 54 61 | 6b 65 20 72 65 6d 61 69 | % Ta|ke remai|
|000045b0| 6e 64 65 72 20 6f 66 20 | 6c 65 76 65 6c 20 77 69 |nder of |level wi|
|000045c0| 64 74 68 0a 20 20 5c 61 | 64 76 61 6e 63 65 5c 74 |dth. \a|dvance\t|
|000045d0| 72 65 65 77 69 64 74 68 | 20 31 65 6d 20 20 20 20 |reewidth| 1em |
|000045e0| 20 20 20 20 20 20 20 20 | 20 20 20 20 25 20 2e 2e | | % ..|
|000045f0| 61 66 74 65 72 20 61 63 | 63 6f 75 6e 74 69 6e 67 |after ac|counting|
|00004600| 20 66 6f 72 20 74 65 78 | 74 20 61 6e 64 20 67 6c | for tex|t and gl|
|00004610| 75 65 2e 0a 20 20 5c 74 | 72 65 65 63 74 72 62 6f |ue.. \t|reectrbo|
|00004620| 78 7b 5c 62 6f 78 5c 74 | 72 65 65 62 6f 78 7d 5c |x{\box\t|reebox}\|
|00004630| 68 73 6b 69 70 20 30 2e | 32 65 6d 20 25 20 41 64 |hskip 0.|2em % Ad|
|00004640| 64 20 74 65 78 74 2c 20 | 73 70 61 63 65 20 62 65 |d text, |space be|
|00004650| 66 6f 72 65 20 63 6f 6e | 6e 65 63 74 69 6f 6e 2e |fore con|nection.|
|00004660| 0a 20 20 5c 74 72 65 65 | 63 74 72 62 6f 78 7b 5c |. \tree|ctrbox{\|
|00004670| 68 72 75 6c 65 20 77 69 | 64 74 68 20 5c 74 72 65 |hrule wi|dth \tre|
|00004680| 65 77 69 64 74 68 7d 5c | 74 72 65 65 63 74 72 62 |ewidth}\|treectrb|
|00004690| 6f 78 7b 5c 62 6f 78 30 | 7d 7d 20 25 20 41 64 64 |ox{\box0|}} % Add|
|000046a0| 20 5c 68 72 75 6c 65 2c | 20 73 75 62 73 2e 0a 5c | \hrule,| subs..\|
|000046b0| 65 6e 64 76 62 0a 0a 25 | 09 72 65 73 74 6f 72 65 |endvb..%|.restore|
|000046c0| 20 2a 20 74 6f 20 74 79 | 70 65 20 6f 72 64 69 6e | * to ty|pe ordin|
|000046d0| 61 72 79 0a 5c 63 61 74 | 63 6f 64 65 60 5c 2a 3d |ary.\cat|code`\*=|
|000046e0| 31 32 0a 0a 5c 65 6e 64 | 69 6e 70 75 74 0a 25 5c |12..\end|input.%\|
|000046f0| 62 79 65 0a | |bye. | |
+--------+-------------------------+-------------------------+--------+--------+